Pages

Thursday, December 16, 2010

Connection String for SQL Server 2008

.NET Framework Data Provider for SQL Server
Type:    .NET Framework Class Library
Usage:  System.Data.SqlClient.SqlConnection

#Standard Security

Data Source=myServerAddress;Initial Catalog=myDataBase;UserId=myUsername;Password=myPassword;

Use serverName\instanceName as Data Source to connect to a specific SQL Server instance. Are you using SQL Server 2008 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server Express installation resides.

#Connect via an IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.

Sumber: http://www.connectionstrings.com

No comments:

Post a Comment

 

Blogger news

About Me

My photo
Palembang, Sumatera Selatan, Indonesia
Seorang yang ingin terus belajar.