Hello Everyone!
Am working on a project and its ready for the production server. I used the windows login controls and ASPNET.mdf as the default database. I have moved the folder containing the project to the production server and deployed it on IIS but when a uer tries to access a page and is redirected to the login screen, it give the following error:

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

Please i need help with this


Recommended Answers

All 6 Replies

Member Avatar

Sounds like a bad connection string.

Everytime I have had this error (usually moving my project to a production server just like you did) it is always because I haven't updated the connection string in the web.config to point to the new database. Or it could be the database hasn't been created on the production server.

I want to use the ASPNETDB.mdf created by the login control in the project directory. This is my connectionstring:

    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />

The IIS is running an instance of SQL Express, right?

this worked. Thanks guys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.