VS 2005 - SQL Express Connection Question

  • Thread starter Thread starter pmclinn
  • Start date Start date
P

pmclinn

I have created a DB from within my Visual studio 2005 development
studio. My connection string works well on my local machine but when
I copy this to my remote server I get this error:

When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)

My connection string looks like this:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|
\MyDatabase.mdf;Integrated Security=True;User
Instance=True;Asynchronous Processing=true;"

The win2003 server this is on is run by me so permissions are not an
issue. I've read in some places that people have enabled TCP and such
from within a management console, is this necessary? The file is in
the data directory and is published directly from visual studio. The
only thing that will connect to this db is the webpage. I do not want
to open public ports to the database. I simply want the db only to be
accessible via normal webpage interactions.

How do I configure this to work?
 
Are you using SQL Server 2005 Express on the production machine?
Whenever I get this error, it's usually related to the connection
string being incorrect. Hope this is helpful.

Regards,

Enrique Martinez
Sr. Software Consultant
 
Back
Top