1.在AlwaysOn Availability Group的.NET Connection String寫法:
The following is an example connection string, where the [AvailabilityGroupListenerName] is the Listener DNS Name that was configured when replicas were created:
Data Source=[AvailabilityGroupListenerName];Initial Catalog = AdventureWorks2008R2; ApplicationIntent=ReadOnly
2.在Database Mirroring 架構下的.NET Connection String寫法:
To automatically redirect connections when a database mirroring failover occurs.
"Data Source=ServerA;Failover Partner=ServerB;Initial Catalog=AdventureWorks;Integrated Security=True;"
3.Connect via an IP address
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
4.Connection to a SQL Server instance
Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;Connection Timeout=120;
5.Connection to a SQL Server Failover Cluster Instance
Server=ClusterName\SQLInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;Connection Timeout=120;
ref:
其他各種寫法(ODBC/ OleDB) :
http://www.dofactory.com/reference/connection-strings
https://www.connectionstrings.com/sql-server/
https://dba.stackexchange.com/questions/61977/how-to-connect-client-applications-to-sql-server-2012-cluster
沒有留言:
張貼留言