Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top