4

I have a SQL Server Db on DiscountASP Server. I have created a Front End in VB.net and trying to insert the values in the Database. Its working great except when i insert some Japanese Characters, the data is stored in the form of Question Marks (???). My Fields in Database are of type nvarchar and before inserting into DB i am not encoding/decoding any strings in VB.net.

Any suggestions on how to store Japanese Characters in DB and then Retrieve them in Japanese as well?

1
  • What is the data type and collation of the column (the collation might be defaulting from table, database or server instance: use properties on the column in SQL Management Studio to see the collation).
    – Richard
    Jan 5, 2011 at 14:05

1 Answer 1

7

When doing your insert or update, you need to prefix your value with N at the front. e.g.

UPDATE thingy SET name = N'こんにちは'

Note that the N is before your single quote. That should fix it =)

1
  • 1
    +1 This is the correct answer. Without the N prefix the literal gets treated as varchar in the databases's default collation. Jan 5, 2011 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.