tayleeming
asked on
Storing/Retrieving UNICODE To SQL Server2000 Using VB.NET
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
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
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
TIM
ASKER
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 : n233n131n145n229n136n169n2 30n152n142
What i do is i take the data that user input and convert it to something like this
n233n131n145n229n136n169n2 30n152n142
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
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 : n233n131n145n229n136n169n2
What i do is i take the data that user input and convert it to something like this
n233n131n145n229n136n169n2
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
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
TIM
ASKER
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 ????...
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 ????...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
https://www.experts-exchange.com/questions/20717813/Urgent-Please-help.html