Chinese garbled solution after the course of GoDaddy database
1. Use Notepad to open the backup good SQL text to ensure that the data in the file is displayed correctly.
2. View the storage format for this text, generally ANSI (Chinese generally refers to GBK or gb2312) and UTF-8.
3. If the file's storage format is ANSI, add the following statement at the top of the SQL file:
/*!40101 SET NAMES GBK * *;
If your file is stored in a UTF-8 format, add the following statement to the top of the SQL file:
/*!40101 SET NAMES UTF8 * *;
4. Save, and then use just the modified SQL file to restore the MySQL tutorial database, it should be done.
My MySQL backup file is too large, more than 300m,ultraedit,editplus are difficult to handle, the result of using Winhex directly modify the SQL file header to be done.
Finally, I started writing code, and I wrote a test code on the page that was the same as using a SQL Server database or an Access database, no different.
MSSQL SERVER ACCESSK Chinese garbled
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Data.OleDb;
Using System.Data;
Using MySql.Data.MySqlClient;
namespace S
{
public partial class _default:system.web.ui.page
{
<summary>
Wukong Note: The following code in the server address and database name and so I marked as Chinese, each according to their own situation to modify the code can be
Goku's Blog www.7es.cn
</summary>
<param name= "Sender" ></param>
<param name= "E" ></param>
protected void Page_Load (object sender, EventArgs e)
{
Goku's Blog Www.111cn.net
Mysqlconnection conn = new Mysqlconnection ("Server= server address; port=3306; database= database name; uid= user name; pwd= ' password ';
Conn. Open ();
Mysqlcommand cmd = new Mysqlcommand ("SELECT * from table name", conn);
Mysqldatareader dr = cmd. ExecuteReader ();
if (Dr. Read ())
{
Response.Write (dr["field name"). ToString ());
}
Dr. Close ();
Dr. Dispose ();
Cmd. Dispose ();
Response.Write ("<br>end");
}
}
}