C# 里EF 对Mysql DB更新,乱码
我是用C#的entity model , 连接字符串是保存在App.Config里的。
加上了charset=utf8之后,就好使了
<?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="takaraEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;User Id=xxx;password=xxx;Persist Security Info=True;charset=utf8;database=xxx"" providerName="System.Data.EntityClient" /> </connectionStrings> </configuration>