Solved

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

Posted on 2014-03-19
3
848 Views
Last Modified: 2014-03-22
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
Comment
Question by:RBS
[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
3 Comments
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 500 total points
ID: 39940509
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
 
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 39940653
what collation are you using for your database?? You may have to do nothing.
0
 

Author Closing Comment

by:RBS
ID: 39948198
Thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

749 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