SqlConnection 各種資料庫連線之 Connection String

1 篇文章 / 0 new
author
SqlConnection 各種資料庫連線之 Connection String
Firebird
Firebird ADO.NET Data Provider
User=SYSDBA; Password=masterkey; Database=SampleDatabase.fdb;
DataSource=localhost; Port=3050; Dialect=3; Charset=NONE; Role=;
Connection lifetime=15; Pooling=true; MinPoolSize=0; MaxPoolSize=50;
Packet Size=8192; ServerType=0;
IBPhoenix Open Source ODBC Driver
Standard / Standard alternative
Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey; DbName=C:\test.fdb
MySQL Connector/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;
Multiple servers
Server=serverAddress1 & serverAddress2 & etc..
;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Using encryption
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Encryption=true;
Using encryption, alternative
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Encrypt=true;
SQL Server 2008
.NET Framework Data Provider for SQL Server
Standard Security
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Standard Security alternative syntax
Server=myServerAddress; Database=myDataBase;
User ID=myUsername; Password=myPassword; Trusted_Connection=False;
Trusted Connection
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
Trusted Connection alternative syntax
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
Connecting to an SQL Server instance
Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
Trusted Connection from a CE device
Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;
User ID=myDomain\myUsername; Password=myPassword;

from http://www.connectionstrings.com/
Free Web Hosting