日期:2014-05-18  浏览次数:20523 次

怎样在ASP.NET中连接MySQL数据库
在ASP.NET中要连接MySQL的数据库,要安装什么程序?
连接MySQL具体代码是怎样的?

------解决方案--------------------

所有连接种类:第一次回帖,,希望给分
MyODBC 2.50 Local database
Driver={mySQL};Server=localhost;Option=16834;Database=myDataBase;


MyODBC 2.50 Remote database
Driver={mySQL};Server=myServerAddress;Port=3306;Option=131072;Stmt=; Database=myDataBase;Uid=myUsername;Pwd=myPassword;


MyODBC 3.51 Local database
Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;

MyODBC 3.51 Remote database
Driver={MySQL ODBC 3.51 Driver};Server=data.domain.com;Port=3306;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

OLE DB, OleDbConnection (.NET)
Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;


Connector/Net 1.0 (.NET)

Standard
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


Specifying port
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


Named pipes
Server=myServerAddress;Port=-1;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


MySqlConnection (.NET)

eInfoDesigns.dbProvider
Data Source=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Command Logging=false;




Standard
Host=myServerAddress;UserName=myUsername;Password=myPassword;Database=myDataBase;


Core Labs MySQLDirect (.NET)

Standard
User ID=root;Password=myPassword;Host=localhost;Port=3306;Database=myDataBase; Direct=true;Protocol=TCP;Compress=false;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;



Standard
Location=myServerAddress;Data Source=myDataBase;UserID=myUsername;Password=myPassword;Port=3306;Extended Properties= " " " ";