This article mainly introduces how to correctly connect to the MySQL database in asp.net. I used asp.net 1.1 to connect to the MySQL database. It turns out that the MySQL database itself provides the provider, download the package from the above address, and then install SETUP, which is very simple and contains SAMPLE.
Currently, FOR is provided based on the version. . NET 1.0, 1.1) References its DLL. The simple code is as follows, which is similar to that of common data. sqlclient.
- using MySQL.Data.MySQLClient;
- ........
- MySQLConnection myConnection=new MySQLConnection("server=localhost;user id=root;password=XXXX;database=baby");
- string sql="select * from admin";
- MySQLDataAdapter myda=new MySQLDataAdapter(sql,myConnection);
- DataSet mydataset=new DataSet();
- myda.Fill(mydataset,"admin");
- mydatagrid.DataSource=mydataset;
- mydatagrid.DataBind();
Is it easy?
The above content is an introduction to connecting to the MySQL database in asp.net. I hope you will get something.
The above content describes how to connect to the MySQL database in asp.net. I hope it will help you in this regard.
Original article title: connecting to MySQL in asp.net
Connection: http://www.cnblogs.com/jackyrong/archive/2005/04/15/138603.html