Solved

Storing/Retrieving UNICODE To SQL Server2000 Using VB.NET

Posted on 2003-11-13
8
441 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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