Solutions for MySQL garbled Processing

Source: Internet
Author: User

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

 
 
  1. <globalization requestEncoding="gb2312" responseEncoding="gb2312"/> 

3. If the database connection string is written in web. config, add

 
 
  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.