Knowledgebase: Databases
Connection String Examples for SQL Server
Posted by Paul Woodland (Import) on 02 December 2006 04:35 AM
If you are located on a server other than "sql01", you should replace sql01 with your server name below. You can find your server on the database page in Helm.

ASP.Net Connection Strings (using SqlConnection object)
Some examples of connection strings to SQL Server using the SqlConnection object in System.Data.SqlClient are shown below, remember to enter your own database, username & password in the correct place:
Data Source=sql01;Network Library=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=USERNAME;Password=PASSWORD;
Server=sql01;Database=DATABASENAME;User ID=USERNAME;Password=PASSWORD;Trusted_Connection=False


ODBC Connection Strings (can be used in ASP, ASP.Net etc)
Remember to enter your own database, username & password in the correct place:
Driver={SQL Native Client};Server=sql01;Database=DATABASENAME;UID=USERNAME;PWD=PASSWORD;


OLEDB Connection Strings (can be used in ASP, ASP.Net etc)
Remember to enter your own database, username & password in the correct place:
"Provider=SQLNCLI;Server=sql01;Database=DATABASENAME;UID=USERNAME;PWD=PASSWORD;
(75 vote(s))
Helpful
Not helpful

Comments (0)