[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2014-03-19
3
Medium Priority
?
957 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 2000 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 83

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

650 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