Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 08-13-2008, 01:33 PM   #1
Solid State Member
Join Date: Aug 2008
Posts: 6
Default Constructing the all important connection string

For any of your new coders needing to create the connection string to the database.


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=,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.

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=myDat aBase;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

jooanu is offline   Reply With Quote
Old 08-13-2008, 06:18 PM   #2
Daemon Poster
xtremezx2's Avatar
Join Date: Sep 2006
Posts: 915
Default Re: Constructing the all important connection string


know it, use it, love it....
xtremezx2 is offline   Reply With Quote

« Pascal? | Hello All »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 02:04 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0