Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to declare "£" symbol in c# and store it in Sql.
Which is the best data type to use in c# and the value in sql.
Posted

It must be NVARCHAR datatype - otherwise you cannot store those special symbols.
Make sure you really use it like this:
@Symbol NVARCHAR(8) OUTPUT 
SqlParameter resultValue = new SqlParameter("@Symbol", SqlDbType.NVarChar, 8);

See more details on following links
http://www.fileformat.info/info/unicode/char/a3/index.htm[^]
http://www.theasciicode.com.ar/extended-ascii-code/pound-sign-symbol-pound-sterling-ascii-code-156.html[^]
 
Share this answer
 
Comments
Maciej Los 29-Mar-14 16:32pm    
+5!
To store these type of encoding characters or symbols... you can use 'nvarchar' datatype in sql...
and for c# you can try like this

"INSERT INTO table_name VALUES(N'£')";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900