0

I am using .net entity framework, asp.net mvc, sqlexpress and have one problem:

when save data to sqlexpress database table (something like this само да пробам) on that table I have this ???? ?? ??????. On column where insert cyrillics data I set collation:Serbian_Cyrillic_100_CI_AI.

Richard Schneider
  • 34,944
  • 9
  • 57
  • 73
user699503
  • 35
  • 6

1 Answers1

1

The datatype of the column should be nvarchar (which is Unicode).

Richard Schneider
  • 34,944
  • 9
  • 57
  • 73
  • `@Richard Schneider`: I'm using text not nvarchar. Is nvarchar good replacement for text data type – user699503 Apr 09 '11 at 00:50
  • @user - Yes. `text` is deprecated but this isn't entirely the correct answer. You can store it in a non unicode column fine as long as the collation is set correctly but need to avoid it getting cast to your database's default collation. `CREATE TABLE #T (C TEXT COLLATE Serbian_Cyrillic_100_CI_AI); INSERT INTO #T VALUES (N'само да робам'); SELECT * FROM #T` – Martin Smith Apr 09 '11 at 01:12
  • Actually, if you want Unicode-capability, use `NTEXT` - or better yet (since TEXT/NTEXT are deprecated): `NVARCHAR(MAX)` – marc_s Apr 09 '11 at 08:43