473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

store chinese again

YAN
i cannot store unicode in thie way, please help!

Dim souce As Byte() = System.Text.Encoding.Unicode.GetBytes("CHINESE")
Dim sSql As String = "insert into tblpitems (fldItmDesc1) values (@a)"
g_dbCommand.CommandText = sSql
Dim paramData As MySqlParameter = New MySqlParameter("@a",
ByteFX.Data.MySqlClient.MySqlDbType.VarChar)
paramData.Value = souce
g_dbCommand.Parameters.Add(paramData)
DBConnection.ExecuteNonQuery()

i store the string as "System.Byte[]", what can i do?
Jul 21 '05 #1
1 1437
YAN <YA*@discussions.microsoft.com> wrote:
i cannot store unicode in thie way, please help!

Dim souce As Byte() = System.Text.Encoding.Unicode.GetBytes("CHINESE")
Dim sSql As String = "insert into tblpitems (fldItmDesc1) values (@a)"
g_dbCommand.CommandText = sSql
Dim paramData As MySqlParameter = New MySqlParameter("@a",
ByteFX.Data.MySqlClient.MySqlDbType.VarChar)
paramData.Value = souce
g_dbCommand.Parameters.Add(paramData)
DBConnection.ExecuteNonQuery()

i store the string as "System.Byte[]", what can i do?


You've specified that it's a VarChar, which means you should specify a
string, not a byte array.

You really shouldn't *need* to do any encoding/decoding yourself at
all. Are you sure your MySql database has been set up to use Unicode?
(I don't know whether it does by default or not.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Coco | last post by:
Hi! I managed to display chinese character in my web form (.aspx), in certain situation i need to to set the text of the label of my web form in chinese character programatically which is done in...
3
by: YAN | last post by:
my database (mysql) would be used to store Simplified Chinese and Traditional Chinese, so i would like to store the text as unicode to the database. I know there is a function...
3
by: Antonio | last post by:
Hi, I want to read an html page written in chinese and store it in a file having extension .aspx , I'm not sure where is the problem, I use the following lines of code: String sAddress =...
0
by: boonkit | last post by:
Currently i store the chinese character in unicode decimal format (&#<number>;). In this way, I can display and search the chinese character correctly. However, this will take more storage space....
177
by: C# Learner | last post by:
Why is C syntax so uneasy on the eye? In its day, was it _really_ designed by snobby programmers to scare away potential "n00bs"? If so, and after 50+ years of programming research, why are...
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
1
by: YAN | last post by:
i cannot store unicode in thie way, please help! Dim souce As Byte() = System.Text.Encoding.Unicode.GetBytes("CHINESE") Dim sSql As String = "insert into tblpitems (fldItmDesc1) values (@a)"...
0
by: enrico.leuzzi | last post by:
Hi, sorry for the newbie question but I'm not able to store chinese characters into a column in a table.... how should the db setted and the table created to be able to store different chars...
0
by: kennymce | last post by:
Hi, I'm having trouble localizing my Oracle 9.2 / ASP web application for our Chinese-speaking users. My Oracle 9.2 Database has NLS_NCHAR_CHARACTERSET set to AL16UTF16. I've set up a test...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.