SQL Server
ODBC
Standard Security: "driver = {SQL Server}; server = aron1; database = pubs; uid = sa; pwd = asdasd;"
Trusted Connection: "driver = {SQL Server}; server = aron1; database = public = yes;"
Prompt for username and password: Oconn.properties ("prompt") = adpromptalwaysoconn.open "driver = {SQL Server}; server = aron1; database = public;"
OLEDB, OLEDBCONNECTION (.NET)
Standard security: "provider = SQLOLEDB; DATA SOURCE = aron1; initial catalog = pubs; user ID = sa; password = asdasd;"
Trusted Connection: "Provider = sqloledb; Data Source = Aron1; Initial Catalog = pubs; Integrated Security = SSPI;" (use serverName / instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000) Prompt for username and password: oConn. Provider = "sqloledb" Oconn.properties ("prompt") = adpromptalwaysoconn.open "Data Source = aron1; initial catalog = public;"
Connect via an IP address: "Provider = sqloledb; Data Source = 190.190.200.100,1433; Network Library = DBMSSOCN; Initial Catalog = pubs; User ID = sa; Password = asdasd;" (DBMSSOCN = TCP / IP instead of Named Pipes , at the end of the data source is the port to use (1433 is the default) SQLConnection (.NET)
Standard Security: "Data Source = aron1; initial catalog = pubs; user ID = sa; password = asdasd;"
Trusted Connection: "Data Source = Aron1; Initial Catalog = pubs; Integrated Security = SSPI;" (use serverName / instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000) Connect via an IP address: "Data Source = 190.190. 200.100,1433; Network Library = DBMSSOCN; Initial Catalog = pubs; User ID = sa; Password = asdasd; "(DBMSSOCN = TCP / IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is DEFAULT) DECLARE The SqlConnection: C #: use system.data.sqlclient; sqlconnection osqlconn = new sqlconnection (); osqlconn.connectionstring = "my connectionstring"; osqlconn.open ();
VB.Net:imports system.data.sqlclientdim osqlconn as sqlconnection = new sqlconnection () osqlconn.connectionstring = "my connectionstring" osqlconn.open ()
Data Shape
MS Data Shape "Province = MSDataShape; Data Provider = Sqloledb; Data Source = aron1; initial catalog = pubs; user ID = sa; password = asdasd;"
Read more
How To Define Wich Network Protocol To Use
Example: "provider = SQLOLEDB; DATA SOURCE = 190.190.200.100, 1433; network library = dbmssocn; initial catalog = pubs; user ID = sa; password = asdasd;"
Name Network Library DBNMPNTW WIN32 Named Pipes DBMSSOCN WIN32 WINSOCK TCP / IP DBMSSPXN WIN32 SPX / IPX DBMSVINN WIN32 Banyan Vines DBMSRPCN WIN32 MULTI-Protocol (Windows RPC)
Important Note! When Connecting THROUGH The Sqloledb Provider Use The Syntax Network Library = DBMSSOCNAND WHEN CONNECTINGH MSDASQL Provider Use The Syntax Network = DBMSSOCN
All SqlConnection Connectionstring Properties
This Table Shows All Connectionstring Properties for the ado.net sqlConnection Object. Most of the Properties Area ALSO Used in ado. All Properties and descriptions is from msdn.
Name Default Description Application Name The name of the application, or '.Net SqlClient Data Provider' if no application name is provided. AttachDBFilename-or-extended properties-or-Initial File Name The name of the primary file, including the full path name , of an attachable database. The database name must be specified with the keyword 'database'. Connect Timeout-or-Connection Timeout 15 The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. Connection Lifetime 0 When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by connection lifetime. Useful in clustered configurations to Force Load Balancing Between A Running Server and a Server Just BROUGHT 'TRUE' DETERMINES WHENER The Database Connection IS RESET WHEN Being Removed from The Pool. Setting To 'Fals e 'avoids making an additional server round-trip when obtaining a connection, but the programmer must be aware that the connection state is not being reset. Current Language The SQL Server Language record name. Data Source-or-Server-or-Address- or-Addr-or-Network address The name or network address of the instance of SQL Server to which to connect. Enlist 'true' When true, the pooler automatically enlists the connection in the creation thread's current transaction context. Initial Catalog-or- Database the name of the database. Integrated security-or-trusted_connection 'false' WHETHER THE CONNECTION IS To Be a Secure Connection or Not. Recognized Values Are 'True', 'False'
, And 'sspi', which is equivalent to 'true'. Max Pool Size 100 The maximum number of connections allowed in the pool. Min Pool Size 0 The minimum number of connections allowed in the pool. Network Library-or-Net 'dbmssocn 'The network library used to establish a connection to an instance of SQL Server. Supported values include dbnmpntw (Named Pipes), dbmsrpcn (Multiprotocol), dbmsadsn (Apple Talk), dbmsgnet (VIA), dbmsipcn (Shared Memory) and dbmsspxn (IPX / SPX), AND dbmsoCN (TCP / IP). The Corresponding Network DLL Must Be Installed On The System To Which You Connect. If You Do Not Specify A Network and You Use A Local Server (for Example, "." OR ". local) "), shared memory is used. Packet Size 8192 Size in bytes of the network packets used to communicate with an instance of SQL Server. password-or-Pwd The password for the SQL Server account logging on. Persist Security Info 'false 'Hen set to 'false', Security-Sensitive Information, Such as The Password, IS NOT RETURNED AS Part of THE C onnection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Pooling 'true' When true, the SQLConnection object is drawn from the appropriate pool, or if necessary, is .
Note Use; to separate each property.If a name occurs more than once, the value from the last one in the connectionstring will be used.If you are building your connectionstring in your app using values from user input fields, make sure the user can 't change the connectionstring by inserting an additional property with another value within the user value Access ODBCStandard Security:. "Driver = {Microsoft Access Driver (* .mdb)}; Dbq = / somepath / mydb.mdb; Uid = Admin; Pwd = asdasd; "
Workgroup: "driver = {Microsoft Access Driver (* .mdb)}; dbq = / somepath / mydb.mdb; systemdb = / somepath / mydb.mdw;", "admin", ""
OLEDB, OLEDBCONNECTION (.NET)
Standard security: "provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; user ID = admin; password = asdasd;"
Workgroup (system database): "provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; Jet OLEDB: System Database = system.mdw;", "admin", ""
With password: "provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; jet oledb: Database password = mydbpassword;", "admin", ""
Oracle ODBC
New version: "driver = {microsoft odbc for oracle}; server = oracleserver.world; uid = username; pwd = asdasd;"
Old Version: "Driver = {Microsoft ODBC Driver for Oracle}; connectionString = Oracleserver.World; UID = myusername; PWD = mypassword;"
OLEDB, OLEDBCONNECTION (.NET)
Standard security: "Provider = msdaora; Data Source = MyOracleDB; User Id = UserName; Password = asdasd;" This one's from Microsoft, the following are from OracleStandard Security: "Provider = OraOLEDB.Oracle; Data Source = MyOracleDB; User Id = UserName; Password = asdasd; "trusted connection:" provike; iole = myoracledb; osauthent = 1; "
OracleConnection (.NET)
Standard: "Data Source = Oracle8i; Integrated Security = YES"; this One Works Only with Oracle 8i Release 3 or LaterDeclare The OracleConnection:
C #: use system.data.racleClient; OracleConnection OracleConn = New OracleConnection (); oracleconn.connectionstring = "my connectionstring"; oracleconn.open ();
VB.NET: IIMPORTS System.Data.OracleClientDim Oracleconn As OracleConnection = New OracleConnection () Oracleconn.Connectionstring = "My Connectionstring" oracleconn.open ()
Data Shape
MS Data Shape: "Provider = MSDataShape.1; Persist Security Info = False; Data Provider = MSDara; Data Source = ORAC; User ID = UserName; Password = MYPW"
MySQL ODBC
Local Database: "driver = {mysql}; server = mysrvname; Option = 16834; Database = mydatabase;"
Remote Database: "driver = {mysql}; server = data.domain.com; port = 3306; option = 131072; stmt =; database = my-data; uid = username; pwd = password;"
OLEDB, OLEDBCONNECTION (.NET)
Standard: "provider = mysqlprov; data source = mydb; user id = username; password = asdasd;" MySQLConnection (.NET)
EID: "Data Source = server; Database = mydb; User ID = username; Password = pwd; Command Logging = false" This one is used with eInfoDesigns dbProvider, an add-on to .NETDeclare the MySqlConnection: C #: using EID.MySqlClient MySQLConnection OmysqlConn = new mysqlconnection (); omysqlconn.connectionstring = "my connectionString"; omysqlconn ();
VB.NET: IIMPORTS Eid.mysqlclientdim omysqlconn as mysqlconnection = new mysqlconnection () omysqlconn.connectionstring = "my connectionstring" omysqlconn.open ()
IBM DB2 OLEDB, OLEDBCONNECTION (.NET) from MS
TCP / IP: "Provider = DB2OLEDB; Network Transport Library = TCPIP; Network Address = XXX.XXX.XXX.XXX; Initial Catalog = MyCtlg; Package Collection = MyPkgCol; Default Schema = Schema; User ID = MyUser; Password = MyPW"
APPC: "Provider = DB2OLEDB; APPC Local LU Alias = MyAlias; APPC Remote LU Alias = MyRemote; Initial Catalog = MyCtlg; Package Collection = MyPkgCol; Default Schema = Schema; User ID = MyUser; Password = MyPW"
Sybase ODBC
Standard: "Driver = {Sybase System 11}; SRVR = aron1; uid = username; pwd = password;"
INTERSOLV 3.10: "Driver = {INTERSOLV 3.10 32-bit Sybase}; SRVR = aron1; uid = username; pwd = password;"
Informix ODBC
Informix 3.30: "DSN = '"; driver = {informix 3.30 32 bit}; host = hostname; server = myserver; service = service-name; protocol = ilsoctcp; database = mydb; uid = username; pwd = mypwd
Informix-CLI 2.5: "Driver = {Informix-CLI 2.5 (32 Bit)}; server = myserver; database = myDb; uid = username; pwd = mypwd
DSN ODBC
DSN: "DSN = MyDSN; UID = Username; PWD =;"
File DSN: "FiledSn = C: /MYDATA.DSN; UID = UserName; PWD =;" Excel ODBC
Standard: "Driver = {Microsoft Excel Driver (* .xls)}; driverid = 790; dbq = c: /myexcel.xls; defaultdir = c: / mypath;"
OLE DB
Standard: "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C: /MyExcel.xls; Extended Properties = Excel 8.0; HDR = Yes;" "HDR = Yes;" indicates that the first row contains columnnames, not dataDBF / FoxPro ODBC
Standard: "Driver = {Microsoft DBase Driver (* .dbf)}; driverid = 277; dbq = c: / mydbpath;"
OLEDB, OLEDBCONNECTION (.NET)
Standard: "provider = microsoft.jet.oledb.4.0; data source = c: / folder; extended profment = dbase iv; user id = admin; password ="
Pervasive ODBC
Standard: "Driver = {Pervasive ODBC Client Interface}; servername = srvname; dbq = @ dbname"
UDL UDL
UDL: "File Name = C: /MYDATALINK.UDL;"