Using SQL Server in. NET is always a thing. A few days ago to learn through JDBC using Java connection MySQL database, I think. NET can also use the MySQL database? The answer is yes, the method is also very simple, where I use C # as a programming language, the way I have sorted out to share with you.
Want to be in. NET to use the MySQL database, the steps are:
1. Download MySQL driver package
2. Reference the MySQL class component that has been compiled in the driver package
3. Write code
Step one: Download the MySQL driver package
When I wrote an article, the latest driver package was 5.2 and supported Visual Studio 2008. The official download address is http://dev.mysql.com/downloads/connector/net/5.2.html.
Step Two:
The downloaded file is a compressed file that is decompressed to the local disk. Locate the MySql.Data.dll file in the Bin folder, which is the component we want to refer to. Refer it to your project through Visual Studio