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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -