Question

I am using SQL EXPRESS EDITION 2005 and Created mdf data file using vb.net 2008. now i want to use this datafile in lan. i modified connection string

"Data Source=.\SQLEXPRESS;AttachDbFilename=\Server\Data\Data1.mdf;Integrated Security=True;User Instance=True;Connect Timeout=60"

it is showing security info error i want to use single database file for my application please help me with connection string. thank you

Was it helpful?

Solution

I see two possibilities...

One, invalid path in your connection string. Change your path:
From: \Server\Data\Data1.mdf
To: \\Server\Data\Data1.mdf (notice the extra backslash at the beginning)

Two, your SQL isn't set up to accept remote connections:

Open the configuration tools, and then click the SQL Server Network Configuration, Click Protocols for SQL Express. Then enable the Shared Memory if not (by default it will be enabled), Named Pipes and TCP/IP and restart the Server. And ensure that your firewall is allowing the remote connections to SQL Server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top