views:

18

answers:

1

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

+2  A: 

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.

Jay Riggs
What should be Data source .\SQLEXPRESS or SERVER\\SQLEXPRESS Can you please give me possible connection string thanks
Rohan
@Rohan - it would be SERVER\SQLEXPRESS. www.connectionstrings.com has an excellent page on SQL Server 2008 connection strings [here](http://www.connectionstrings.com/sql-server-2008).
Jay Riggs