The following articles mainly describe asp.net's connection to MySQL. The information I saw on the relevant website two days ago is very good and I will share it with you. The following is a detailed introduction to asp.net's connection to MySQL. I hope this will help you in your future studies.
Recently I tried to use asp.net 1.1 to connect to MySQL. It turns out that MySQL itself provides the provider (http://www.MySQL.com/products/connector/net ),
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 MySQL in asp.net. I hope you will have some gains.