Demonstration of connecting to MySQL database in asp.net

Source: Internet
Author: User
Today, I am mainly talking about the correct operation process for connecting to the MySQL database in asp.net. We all know that the process of connecting to the MySQL database in asp.net is not complicated, is there any way we use ELE. Me? The following is the detailed description of the article. I recently tried to use asp. net1.1 to connect to MySQL. It turns out that MySQL itself provides

Today, I am mainly talking about the correct operation process for connecting to the MySQL database in asp.net. We all know that the process of connecting to the MySQL database in asp.net is not complicated, is there any way we use ELE. Me? The following is the detailed description of the article. Recently I tried to use asp.net 1.1 to connect to MySQL. It turns out that MySQL itself provides

Today, I am mainly talking about the correct operation process for connecting to the MySQL database in asp.net. We all know that the process of connecting to the MySQL database in asp.net is not complicated, is there any way we use ELE. Me? The following is the detailed description of the article.

Recently I tried to use asp.net 1.1 to connect to MySQL. I found that MySQL itself provides provider (), downloaded it from the above address, and then installed SETUP, which is very simple and also contains SAMPLE.

When using the SDK, you must first provide the FOR 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.