Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Actually before i did not use framework or linq, just type in sql statement with Sqlcommand class, i type in insert into table values(N'sample') actually i donot know what is N, but it works for Chinese and other Language, otherwise, it will insert some question mark.

But when i use EntityFramework,this kind of framework always insert some question mark, can i ask how to tackle the issue.

N means Unicode? Can you give me one example that EntityFramework use that sort of thing?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
359 views
Welcome To Ask or Share your Answers For Others

1 Answer

  1. in .edmx Table, select column -> check its properties and set unicode to true
  2. re-generate table if you are working in Code First Apporach
  3. check your database table, it should be nvarchar or ntext datatype

this way EF will save unicode characters.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...