Monday, February 20, 2012

My question would have been...

Hi,

I am developing an application using C#.NET that accesses a remote database that that contains japanese characters.

My sample querry is strCommand = "SELECT * FROM table WHERE prodname = 'CR新海物語スペシャルM8'";

The result of querry displayed in the binded datagrid also contains other rows that has this prodname:

CRF湯けむり紀行SF-T
CRぱちんこハイサイVR1
CRホワイトエンジェルFS

etc.

Thanks in advance for your help.

You forgot to ask a question.
|||

Hi,

I am developing an application using C#.NET that accesses a remote database that that contains japanese characters.

My sample querry is strCommand = "SELECT * FROM table WHERE prodname = 'CR新海物語スペシャルM8'";

The result of the querry above that is displayed in the binded datagrid also contains other rows that has this prodname:

CRF湯けむり紀行SF-T
CRぱちんこハイサイVR1
CRホワイトエンジェルFS

etc.

Why does the command yields other records where the prodname field contains the 'CR' thing?

Sample querry result in a datagrid:

field1 field2 field3 prodname

a as er CR新海物語スペシャルM8

w aa ww CRF湯けむり紀行SF-T

ss dd ee CRぱちんこハイサイVR1

sdds ddd ee CR新海物語スペシャルM8

rf d5r wwe CRぱちんこハイサイVR1


Does this strange and redundant output has something to do with the Japanese characters contained in some fields

of the table?

Thanks in advance for your help.


|||Try with the correct nvarchar syntax:

SELECT * FROM table WHERE prodname = N'CR新海物語スペシャルM8'

No comments:

Post a Comment