This article mainly describes the actual application of asp.net to process MySQL garbled characters. We all know that MySQL often occurs in actual operations, so how does asp.net use the correct application for MySQL garbled processing? The following describes the related content.
When asp.net is dealing with the MySQL database, due to configuration problems, it may encounter a self-written method when reading data in the database, English, numbers can pass normally, however, you cannot use Chinese characters. If you use logon as an example, you can log on normally when you enter an english user name. However, if you enter a noon user name, an error is returned. The solution is as follows:
1. Find the my. ini file in the installation directory of the MySQL database, change the value of default-character-set to default-character-set = gb2312, and save and restart.
2. Find the web. config file of the asp.net file and add the
- <globalization requestEncoding="gb2312" responseEncoding="gb2312"/>
3. If the database connection string is written in web. config, add
- Charset = gb2312 For example: <add key = "test" value = "server = localhost; database = dBTest; uid = root; pwd = root; charset = gb2312"/>)
Tag: MySQL garbled
The above content is an introduction to asp.net's use of MySQL for garbled processing. I hope you will get some gains.
The above content is a description of asp.net's use of MySQL for garbled processing. I hope it will help you in this regard.
Original article title: asp.net uses MySQL for garbled Processing
Connection: http://www.cnblogs.com/panjun-donet/archive/2010/04/01/1701947.html