Sunday, March 14, 2010

SQL Connection Strings samples

SQL Server

OleDb Sql Connection String - user and password

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;


OleDb Sql Connection String - trusted connection (integrated authentification)

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

Mysql

Standard
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Specifying port
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Specifying default command timeout
Use this one to specify a default command timeout for the connection. Please note that the property in the connection string does not supercede the individual command timeout property on an individual command
object.Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;default command timeout=20;

No comments:

Post a Comment