Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL
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 28-Mar-14 1:17am
KRI19467
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  
Comments
Maciej Los at 29-Mar-14 16:32pm
   
+5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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'£')";
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 200
1 PIEBALDconsult 150
2 BillWoodruff 148
3 Jochen Arndt 135
4 DamithSL 130
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 28 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100