Tutorial RSS
 
Navigator: Home - Connect - Constructing the all important connection string

Constructing the all important connection string

Constructing the all important connection string

How to connect via an IP address:

Connection string formats will vary depending on the data source. Connecting by IP Address is very common and easy to use. Below is the connection string using the IP of the database server to connect to.

Data Source=100.100.100.1,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.

We moved our web sites to Server Intellect and have found them to be incredibly professional. Their setup is very easy and we were up and running in no time.


Connecting to a SQL Server instance:

The syntax of specifying the server instance in the value of the server key is the same for all connection strings for SQL Server.

Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
 
Trusted Connection from a CE device:

Often a Windows CE device is not authenticated and logged in to a domain. To use SSPI or trusted connection / authentication from a CE device, use this connection string.

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;
 
Note that this will only work on a CE device.

If you're ever in the market for some great Windows web hosting, try Server Intellect. We have been very pleased with their services and most importantly, technical support.


411asp.net123aspxDotNetFreaksServer Intellect