I am running my ASP.NET application in IIS as a site. When I go to login to the website through the SQL Server database, it returns an error. I can run the web application through Visual Studio using IIS Express without any issues.
I have looked at tutorials saying to check my connection string.
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-VideoStore-20190515111127.mdf;Initial Catalog=aspnet-VideoStore-20190515111127;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
This is the 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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)
I use the Server Explorer to look at the Data Connections>Default Connection (Video Store) to see the database in Visual Studio. Can someone point me in the right direction?