Solved

Storing/Retrieving UNICODE To SQL Server2000 Using VB.NET

Posted on 2003-11-13
8
425 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now