下载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());
   }
posted on 2005-04-12 17:16  jerry.zheng  阅读(5301)  评论(8编辑  收藏  举报