在web.config文件中添加如下样式的数据库链接字符串:

 

 <add name="dbconnection" connectionString="DataBase=databasename;Server=127.0.0.1;Uid=用户名;Pwd=密码;character set=gbk;" providerName="MySql.Data.MySqlClient"/>

  </connectionStrings>

其中character set=gbk为数据库中的编码方式,gbk或utf-8,根据实际数据库中创建的编码方式来确定

相关文章:

  • 2021-12-26
  • 2021-05-14
  • 2021-12-28
  • 2021-06-26
  • 2022-01-14
  • 2021-07-02
  • 2021-05-30
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2021-11-21
  • 2021-06-10
  • 2021-10-14
  • 2021-11-18
相关资源
相似解决方案