In the where of the query statement, if you want to query the conditions that contain Chinese, you will never find the value, the feeling is a problem.
Added "Character Set=utf8" in the connection string
I used the entity Framework to connect to MySQL a long time ago, and there was no Chinese garbled problem. This use, the database is UTF8 code, supposedly, also should not garbled, but unfortunately, unexpectedly garbled. Finally, the solution was found: simply add Character Set=utf8 to the connection string in the configuration file
add more:
1. MYSQL: Ensure all the columns are in the UTF8 format.
2. VS2010: When establishing a connection in data server, select Advance, set Chracterset to UTF8, so that when you view and change data in MySQL in VS2010, you will not see a lot of garbled characters because of the mismatch.
3. Entity Framework: Our page is connected to MySQL using EF, which also needs to be set.
A. Try to establish a connection with a DataSource, and save the connection string in Web. config, as in the previous connection, set CharacterSet to UTF8, which can be checked in Web. config, for example: < Span style= "Box-sizing:border-box; Color: #666666; font-family: Microsoft Ya-hei, Verdana, ' Ms Song ', song Body, Arial, Helvetica, Sans-serif; line-height:21px; Background-color: #dddddd; " > character Set=utf8 ;d Atabase=map "providername=" MySql.Data.MySqlClient "/>
B. When you create a new EF model, you select the database connection and choose the one that is mentioned in 1, which will ensure that the Web page is displayed and that the changed Chinese can be updated correctly to MySQL.
MySQL query does not reach the Chinese problem