The database Asp.net + MSSQL 2000 was used by the website. As a result, the new project says that the MSSQL database is too expensive and you need to change it to MySQL.
Connector/NET 6.3.5
Http://www.mysql.com/downloads/connector/net/
Latest Database Connector: http://mysql.stu.edu.tw/Downloads/Connector-Net/mysql-connector-net-6.3.5.zip
After the installation, introduce the corresponding dynamic link library mysql.net and using namespace in the project: mysql. Data. mysqlclient (thisCode)
Since then, in MSSQL code, you only need to replace all the SQL statements with MySQL. Before that, you can use the SQL Server database code to directly use the MySQL database.
Problem 1: "The requested. NET Framework data cannot be found to provideProgram. It may not be installed. "Error
Use the above method to replace the SQL statement in the entire project with MySQL. There is no problem on the local test page, but submit
How to operate this part on the server .?!!
In the development stage, you can install mysql-connector-net-6.3.5.zip to ensure development is complete.
However, if the connector is not installed on the server, problems may occur.
Solution: Reference: http://www.cnblogs.com/scottckt/archive/2009/12/30/1636475.html
Add the following code in Web. config to solve the problem: "The requested. NET Framework data provider cannot be found. It may not be installed ." . <! -- MySQL usage -->
< System. Data >
< Dbproviderfactories >
< Add name = " Mysql Data Provider " Invariant = " MySQL. Data. mysqlclient " Description = " . NET Framework data provider for MySQL " Type = " MySQL. Data. mysqlclient. mysqlclientfactory, MySQL. Data, version = 6.3.5.0, culture = neutral, publickeytoken = c5687fc88969c44d " />
</ Dbproviderfactories >
</ System. Data >
Solve the problem!
If your version is not 6.3.5.0, you only need to modify version = in the above Code.
Additional reading:ASP. net2.0 using MySQL ODBC driver-myodbc 3.51 to connect to MySQL database
Http://www.longtengwang.com/Article/shujuku/MySQL/200712/7791.html