标签:
1.保证mysql数据的编码为utf8
启动mysql
mysql -hlocalhost -uroot -p
输入密码
show VARIABLES like ‘character_%‘;
SET character_set_client=‘utf8‘;
SET character_set_connection=‘utf8‘;
SET character_set_results=‘utf8‘;
2.已经生成数据库的,注意数据库的collation,表的collation,以及表中字符串列的collation都要为utf8
2.在EF连接字符串中添加Character Set=utf8
标签:
原文地址:http://www.cnblogs.com/qinghub/p/5699099.html