如:Linq的where查询条件中有中文查询不到,则需要更改web.confgi配置文件中与数据库的连接
添加:Charset=utf8
<appSettings>
<add key="TEST" value="Server=localhost;Database =test;UID=test;PWD=test;Charset=utf8 " />
</appSettings>
添加:Character Set=utf8
<connectionStrings>
<add name="test" connectionString="metadata=res://*/AO.AOModel.csdl|res://*/AO.AOModel.ssdl|res://*/AO.AOModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;password=test;user id=test;database=test;Character Set=utf8;persistsecurityinfo=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
则查询中文正常
原文:https://www.cnblogs.com/xuzy-x/p/13588657.html