0

Hi,
I'm working on a multi user VB.Net windows application with back end as SQL Server 2008 Express. The SQL Server is installed on the intranet network drive. This is the connection string I will be using. Is this correct?

Data Source=.\SQLEXPRESS;AttachDbFilename=Q:\Database\PrintDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True

Thanks

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by shers
0

Sorry, I have changed the connection string to this, as the SQL server is installed in a network server and the database is placed in the local D: drive of the server. This is the connection string.

"Data Source=ServerName\SQLEXPRESS;Database=D:\PrintRequestDatabase\PrintDB. mdf;Trusted_Connection=True;"

The error I get is 'Cannot open database ......'

0

The easist way to connect to a database is as follows

Driver={sql server};trusted_connection=yes;server=servername\SQLEXPRESS;database=database name

Just make sure you have no spaces in the string. You can you this method to connect with any server on your network provided you have peermission to do so. Your program does not need to know the physical location of the database - SQL Server takes care of this.

0

Thanks all for your help. I solved it. I think I had messed with the user permission in the database. I deleted the database file and recreated a new one in the remote server. And it works!

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.