Methods and examples of. NET connection to MySQL database
Method One:
Use MySQL to launch the MySQL connector/net is a ado.net driver for MySQL, below provide the latest version of the download
Http://www.weiqisj.cn/mysql-connector-net-6.0.2.zip
This component is a. NET access component for MySQL to access the MySQL database for ado.net.
After installation completes the component, the namespace MySql.Data.MySqlClient is referenced;
When compiling using the command line: Csc/r:mysql.data.dll Test.cs
Method Two:
Access to the MySQL database through ODBC
Download two components before accessing: ODBC Driver for Odbc.net and MySQL (MySQL connector/odbc (MYODBC) driver) is currently version 3.51
After the installation is complete, you can access the MySQL database via ODBC
Method Three:
Use the MySQL access component launched by Corelab to target. NET
After the installation is complete, reference namespaces: Corelab.mysql;
Compile with command: Csc/r:corelab.mysql.dll Test.cs