• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 991
  • Last Modified:

Converting from Single byte to double byte - C# - MS SQL

Hi:

I have a C# application that I need to convert to be able to hold non western characters.  The application then needs to store data in an MS SQL database.

How, for example could I take a non-western word from a text box in C# and then convert it and store in sql database.  If the original field was nvarchar(20) in the db, what type of field should I now use in the db to store it?

Any help greatly appreciated.

RBS
0
RBS
Asked:
RBS
1 Solution
 
anarki_jimbelCommented:
Check the MS link below:

http://msdn.microsoft.com/en-us/library/ms186939.aspx

Nvarchar columns take up twice as much space over the non-unicode counterparts (char and varchar).

When inserting into unicode columns, use N to indicate it's unicode text:

INSERT INTO MyUnicodeTextTable(NvarcharColumnText)
VALUES (N'someUnicode text')
0
 
David Johnson, CD, MVPOwnerCommented:
what collation are you using for your database?? You may have to do nothing.
0
 
RBSAuthor Commented:
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now