下载MySql.Data.msi
连接代码:
MySQLConnection conn = new MySQLConnection(new MySQLConnectionString("192.168.0.103","jery","root","root").AsString);
DataSet ds = new DataSet();
MySQLDataAdapter ada = new MySQLDataAdapter("select * from T_User",conn);
try
{
conn.Open();
ada.Fill(ds,"jery");
conn.Close();
this.DataGrid1.DataSource = ds.Tables[0].DefaultView;
this.DataGrid1.DataBind();
}
catch(Exception ex)
{
Response.Write(ex.Message.ToString());
}