locked
Query with unicode characters. RRS feed

  • Question

  • Which is better to use in C#when query contains unicode characters.

    1.Prefix with N'' (or) 2. Parameter binding with passing type as SQLDBtype.NVarchar .

    • Changed type Naomi N Friday, December 21, 2012 2:52 PM Question rather than discussion
    Friday, December 21, 2012 10:35 AM

Answers

  • Use parameter binding with the correct type.
    • Proposed as answer by Naomi N Friday, December 21, 2012 2:53 PM
    • Marked as answer by puni_vidhya Monday, December 24, 2012 6:47 AM
    Friday, December 21, 2012 10:55 AM

All replies

  • Use parameter binding with the correct type.
    • Proposed as answer by Naomi N Friday, December 21, 2012 2:53 PM
    • Marked as answer by puni_vidhya Monday, December 24, 2012 6:47 AM
    Friday, December 21, 2012 10:55 AM
  • You should always use parameter binding, Unicode or not!


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Naomi N Friday, December 21, 2012 2:53 PM
    Friday, December 21, 2012 11:34 AM
  • Hi puni_vidhya,

    In C# you can use STRING data type for unicode data that is stored in database.

    Friday, December 21, 2012 1:24 PM