Friday, February 10, 2012

Connecting to SQL Server Express 2005 using VB.NET 2005 fails

Dear Sir,

We are using VB.NET 2005 (Winform) and the backend SQL Server Express 2005. We would like to connect the Express (.mdf) database from Remote Machine. What type of connection string we have to use?

We tried the following ConnectionString but we got the error:
Provider=SQLNCLI.1;Server=.\SQLEXPRESS;AttachDbFileName=S:\MLJData.mdf;Database=MLJData;Trusted_Connection=Yes;

Also suggest what are all the prerequisites to run sql server express 2005 database in client machine.

We did installed the following tools in client machine:

1. .NET framework 2.0
2. sqlncli.msi (SQL Server Native Client Setup)

Please provide us the solution for this.

Thanks
M. Gopalan
Sofist India

okugops@.hotmail.com

hi,

databases have to be "local" to the computer running the SQL Server instance they have to be attached to.. both for security and performance issues...

regards

|||You have "Server=.\SQLEXPRESS". In this case, it will connect to local instance (i.e. local instance on the remote machine). You should specify the name of the remote server. Also make sure SQL Browser is running. And be careful about firewall.|||

Hi,

refer www.connectionstrings.com for more on connection string.

Hemantgiri S. Goswami

No comments:

Post a Comment