views:

262

answers:

2
DataRow[] rows = myDataSet.Tables[0].Select("name = '" + _string + "'");

If _string contains UNICODE characters, do I need to prefix it with N like in TSQL?

DataRow[] rows = myDataSet.Tables[0].Select("name = N'" + _string + "'");

Thanks!

A: 

I tested it. Adding an N-Prefix will throw an exception.

You don't need to put the N-Prefix even if you are working with Unicode characters.

Ian
A: 

DataRow[] rows = myDatatable.Select("name = '" + _string + "'");

_string includes Myanmar Unicode string and wrong result returns(i.e. it returned all strings that include Myanmar Characters). What's wrong with me?

I also tried myDatatable.DefaultView.RowFilter("name = '" + _string + "'"); the same wrong result return.

zawmn83