Solved

Storing/Retrieving UNICODE To SQL Server2000 Using VB.NET

Posted on 2003-11-13
8
431 Views
Last Modified: 2007-12-19
hi,

  i m doing some window application uding VB.net, due to some reason i need to know how to store & retrieve UNICODE ,let say using UTF8 to & from SQL Server 2000. Anyone have solution for this? Thanks

 
0
Comment
Question by:tayleeming
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Expert Comment

by:mondayblueboy
ID: 9746047
Please let me know if the link below could help
http://www.experts-exchange.com/Programming/Q_20717813.html
0
 
LVL 4

Expert Comment

by:timmyt851
ID: 9751478
Can't you just use nvarchar and ntext fields? I don't think you need to do anything differently in VB, as long as the SQL column type supports unicode (the ones that start with "n").

TIM
0
 

Author Comment

by:tayleeming
ID: 9760900
hi,
  Actually i already do something about it and now i wish to know is the way i doing thing is correct.

My Objective : to store the information(especially chinese character) in SQL Server 2000 as UNICODE(using UTF8 format)

Now, i have manage to store the data inside SQL Server 2000 as something similar as below

Field Name : CustName
Data Type : nvarchar
Length : 4000
Data : n233n131n145n229n136n169n230n152n142


What i do is i take the data that user input and convert it to something like this

n233n131n145n229n136n169n230n152n142

then i store in database

when retrieve, i convert it back to the character or string that as the user input early

is this the correct way of doing it? or else?

coz i found that this way will take up alot of storing storega than usual
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 4

Expert Comment

by:timmyt851
ID: 9761674
I'm curious, what happens if you just try storing the actual characters into an nvarchar field? Does it break or what happens? I was under the impression that nvarchar fields could store that kind of information without any conversion.

TIM
0
 

Author Comment

by:tayleeming
ID: 9761720
to timmyt851

    i try the way u comment, but seem like the SQL Server will store the chinese character i insert in a different way, which is normally display as ???? Then when i retrieve it out, it also display as ????...
0
 
LVL 5

Accepted Solution

by:
mondayblueboy earned 75 total points
ID: 9761730
Hope the following links can give you better explanation,

INF: Unicode String Constants in SQL Server Require N Prefix
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q239/5/30.ASP&NoWebContent=1

Data Access (SQL Server) (ADO.Net)
http://www.developersdex.com/gurus/articles/500.asp?Page=6

Unicode Support in SQL Server 7.0 Simplifies International Localization
http://www.cplus-zone.com/tips/Tip/13109
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10267948
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: mondayblueboy {http:#9761730}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question