Error connecting to SQL Server 2012 database - using IIS 7.5 server

Asked

Viewed 397 times

2

I’m getting this Error.

Instance-specific or network error when connecting to SQL Server. The server was not found or not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Preview: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an Automatic instance. See the Windows Application Event log for error Details. ).

This minor error occurs when trying to connect to the database, using IIS Server 7.5, but through Iisexpress, which starts directly from Visual Studio Web 2013, the connection usually occurs.

Connection Data:

Connection String: Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\inetpub\wwwroot\LocalIIS\secondsite\App_Data\aspnet-secondsite-91d3d8bf-0c8d-4f0a-9165-96960db8ab1b.mdf;Initial Catalog=aspnet-secondsite-91d3d8bf-0c8d-4f0a-9165-96960db8ab1b;Integrated Security=True;User Instance=False

Provider:

.NET Framework Data Provider for SQL Server

Type:

Microsoft SQL Server

Version:

11.00.3000

  • Fabiano, have you seen if sql server is running ? Because VS would not need an instance of sql server on the computer. This error usually happens when sql server is shut down.

1 answer

1

Just try to

Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\inetpub\wwwroot\LocalIIS\secondsite\App_Data\aspnet-secondsite-91d3d8bf-0c8d-4f0a-9165-96960db8ab1b.mdf;Integrated Security=True;Connect Timeout=30

Browser other questions tagged

You are not signed in. Login or sign up in order to post.