views:

32

answers:

2

i have a code which has the connection string as driver. dim s as string = "Driver={SQL Server}; Server=xxx\SQLEXPRESS; Database=dbRegister; Trusted_Connection=yes"

i need to change that to - "data source=1.2.3.4;user id=xx;password=xxxxx;initial catalog=xxxxx;Connect Timeout=30"

when i just change the text it gives this error - "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" how do i declare the datasource?

A: 

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.

Are you using SQL Server 2005 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server 2005 Express installation resides.

visit

http://www.connectionstrings.com/

for all types of connection strings.

Jeeva S
A: 

Don't forget your instance name, i.e., Data Source=1.2.3.4\SQLEXPRESS.

JonathanK