VS2005连接Sql2005,Sql2000,Access,Oracle四种数据库的字符串
1.Sql server2005
Data Server=.\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=sa123456 [版权所有:http://DOC163.com]
Data Server=服务器名\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=sa123456
Data Server=localhost\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=sa123456
[资料来源:http://Doc163.com]
Data Server=.;Initial Catalog=Northwind;User ID=sa;Password=sa123456 [资料来源:www.doc163.com]
Data Server=服务器名;Initial Catalog=Northwind;User ID=sa;Password=sa123456 [来源:http://www.doc163.com]
以上五种字符串针对不同的SQL 2005版本
2.Access [来源:http://Doc163.com]
string source = @" Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = D:c#connDBschool.mdb";
3.Sql server2000
string source = @" server = .kingsql;database = Northwind ; integrated security=SSPI ";
[资料来源:www.doc163.com]
string source = @" server = .kingsql;database = Northwind ; uid = sa; pwd = sa ";
4.Oracle [资料来源:http://www.doc163.com]
(1)ODBC(要求:Oracle Client 7.3以上版本)
"Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;Pwd=myPassword;"
[资料来源:http://doc163.com]
(2)OLEDB(要求:Oracle Client 8i以上版本)
"Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;" [来源:http://Doc163.com]
(3)System.Data.OracleClient(要求:MDAC 2.6Oracle Client 8i Release 3 (8.1.7) 以上版本)
"Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"
(4)ODP.NET(要求:Oracle Client 9i以上版本)
"Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;" [来源:http://www.doc163.com]
(5)OraDirect .net (要求:不需要安装Oracle客户端必须购买许可证)
"User ID=myUsername;Password=myPassword;Host=ora;Pooling [资料来源:http://www.doc163.com]
[资料来源:Doc163.com]