2

I am writing a WindowsForm application. I am using Visual Studio local database. Every thing is OK, but if I write some UTF8 content in forms, after saving and getting the content again it shows in this form "????". I think there is problem with database, but I don't know how to configure database to store utf8 content.

littleali
  • 408
  • 1
  • 6
  • 22

2 Answers2

4

The field in the database needs to be an nvarchar instead of a varchar.

RyanB
  • 757
  • 4
  • 11
1

Depending on how you save your information to database, if it is inline sql then prefix your content with N'yourvalue'.

rfolt
  • 111
  • 5