首页 > 代码库 > 几种连接不同数据库的ADO.NET字符串
几种连接不同数据库的ADO.NET字符串
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;或者
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;Trusted_Connection=False;
可信连接:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;或者
Server=myServerAddress;Database=myDatabase;Trusted_Connection=True;
2> Access连接字符串
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myDatabase.mdb;User Id=admin;Password=;
3>MySQL连接字符串
Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;
4>DB2连接字符串
Server=myAddress:myPortNumber;Database=myDatabase;UID=myUsername;PWD=myPassword;
5>Oracle连接字符串
Data Source=TORCL;User Id=myUsername;Password=myPassword;