ADO.net连接字符串

基本语法:数据源(Data Source)+数据库名称(Initial Catalog)+用户名(User ID)+密码(Password)

SQL Server连接字符串

标准安全连接: 

Data Source=.;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; 

Access连接字符串

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myDatabase.mdb;User Id=admin;Password=;

MySQL连接字符串

Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;

DB2连接字符串

Server=myAddress:myPortNumber;Database=myDatabase;UID=myUsername;PWD=myPassword;

Oracle连接字符串

Data Source=TORCL;User Id=myUsername;Password=myPassword; 

你可能感兴趣的:(ADO.net连接字符串)