Questo post illustra le varie possibili connessioni che possono essere effettuate su Database Sql Server 2000 e 2005:
SQL Server
ODBC
Connessione
Standard Security:
"Driver={SQL Server};Server=Zues;Database=Northwind;Uid=sa;Pwd=prova;"
Connessione Trusted
connection:
"Driver={SQL Server};Server=Zeus;Database= Northwind;Trusted_Connection=yes;"
OLE DB, OleDbConnection (.NET)
Connessione
Standard Security:"Provider=sqloledb;Data
Source=Zeus;Initial Catalog= Northwind;User Id=sa;Password=prova;"
Connessione Trusted
connection:
"Provider=sqloledb;Data Source=Zeus;Initial Catalog= Northwind;Integrated
Security=SSPI;" Connessione tramite indirizzo IP:
"Provider=sqloledb;Data Source=100.100.200.300,1433;Network Library=DBMSSOCN;Initial
Catalog= Northwind;User ID=sa;Password=prova;"
(1433 è la porta di default di connessione di Sql Server)
SqlConnection
(.NET)
Connessione
Standard Security:"Data Source=Zeus;Initial Catalog= Northwind;User
Id=sa;Password=prova;"
- or -"Server=Zeus;Database= Northwind;User ID=sa;Password=prova;Trusted_Connection=False"
Connessione Trusted
connection:"Data Source=Zeus;Initial Catalog= Northwind;Integrated
Security=SSPI;"
- or -"Server=Zeus;Database= Northwind;Trusted_Connection=True;"
Connessione tramite
indirizzo IP:
"Data Source=100.100.200.300,1433;Network Library=DBMSSOCN;Initial
Catalog= Northwind;User ID=sa;Password=prova;"
SQL Server 2005
SQL Native Client ODBC Driver
Connessione
Standard Security:"Driver={SQL Native Client};Server=Zeus;Database= Northwind;UID=sa;PWD=prova;"
Connessione Trusted
connection:
"Driver={SQL Native Client};Server=Zeus;Database= Northwind;Trusted_Connection=yes;"
SQL
Native Client OLE DB Provider
Connessione Standard Security:"Provider=SQLNCLI;Server=Zeus;Database=
Northwind;UID=sa;PWD=prova;"
Connessione
Trusted
connection:
Provider=SQLNCLI;Server=Zeus;Database= Northwind;Trusted_Connection=yes;"
SqlConnection(.NET)
Connessione Standard Security:"Data Source=Zeus;Initial
Catalog= Northwind;User Id=sa;Password=prova;"
- or -
"Server=Zeus;Database= Northwind;User ID=sa;Password=prova;Trusted_Connection=False" Connessione Trusted connection:"Data Source=Zeus;Initial
Catalog= Northwind;Integrated Security=SSPI;"
- or -
"Server=Zeus;Database= Northwind;Trusted_Connection=True;"