在VB.Net和MySQL中插入和显示unicode数据 [英] Inserting and displaying unicode data in VB.Net and MySQL

查看:97
本文介绍了在VB.Net和MySQL中插入和显示unicode数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我在使用unicode,vb.net和mysql遇到麻烦

我正在尝试以unicode保存一些印度(印度)语言数据,

而mySQL表结构就像

Hi friends

Im in a trouble with unicode , vb.net , and mysql

Im trying to save some indic (Indian) language data in unicode ,

And the mySQL table structure is some thing like

<br />
create table names_collection<br />
(<br />
name_en varchar(50),<br />
name_il varchar(150) charset ''utf8''<br />
)<br />




当我尝试使用mysql过程和mysql连接器mysqlcommand插入数据时,将其插入数据,但是当我使用数据集并选择通用unicode字体将其填充到datagridview中时
Arial Unicode MS,我在unicode字段中获取了一些垃圾字符

谁能帮我一些示例代码,用于unicode/vb/mysql组合

问候
john




when i try to insert the data , using a mysql procedure , and mysql connectors mysqlcommand, its inserting data but when I fill it in datagridview using dataset and selectting the universal unicode font
Arial Unicode MS , Im geting some junk chars in unicode filed

Could any any one ,help me with some sample code , for unicode/vb/mysql combination

regards
john

推荐答案

我认为nvarchar是unicode吗? VB字符串都是unicode.为什么要使用UTF8,这可能不会只是使事情变得混乱?
I thought nvarchar was unicode ? VB strings are all unicode. Why use UTF8, mightn''t that just confuse things ?


基督教徒是正确的-将字段的数据类型分别更改为nVarChar(50)nVarChar(150).

删除charset ''utf8''内容.
Christian is correct - change the datatype of your fields to nVarChar(50) and nVarChar(150) respectively.

Drop the charset ''utf8'' stuff.


将; charset = utf8附加到连接字符串
一切都会好起来的


问候
约翰
Append ;charset=utf8 to connection string
all is going to be fine


regards
john


这篇关于在VB.Net和MySQL中插入和显示unicode数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆