c# - How do I add an object with the entity framework when it has attribute to store data in utf-8 -


my application has entity in db has 2 fields [id, word] word store urdu words in written in unicode. fields have been created in db such on manually entering data being added when try same thing via entity framework instead of proper words ???? appear . sr stream reading. , word entity.

while (!sr.endofstream) {     string line = sr.readline();     word w = new word();     w.name=line.trim();     context.words.addobject(w); } context.savechanges();  

and entity created in mysql 5.0

create table `word` (   `wordid` int(10) unsigned not null auto_increment,   `name` varchar(80) character set utf8 collate utf8_bin not null,   primary key  (`wordid`) ) engine=innodb auto_increment=15716 default charset=latin1; 


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -