I have sqlexpress installed on my dev laptop along with vs2019. I can access the sql instance in both SSMS and from the Server Explorer. When I go to debug and asp.net project, the sql connection fails with:
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)
This same configuration works on my desktop - same connection strings - no problem. And laptop sql is configured to allow remote connections.
Not sure what to do next?
Thanks Abbott
Additional Info ... I made sure the named pipes and tcpip were enabled and browser was working. Still had same error. Here are the connection strings. The desktop connection works on my desktop:
<!--Local DB For Desktop Testing-->
<!--<add name="DBConn" connectionString="data source=DESKTOP-QQOLG5N\SQLEXPRESS;initial catalog=kidsbookoutlet;integrated security=SSPI;persist security info=True;packet size=4096" />
<add name="KBODataEntities" connectionString="metadata=res://*/Context.KBODataEntities.csdl|res://*/Context.KBODataEntities.ssdl|res://*/Context.KBODataEntities.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-QQOLG5N\SQLEXPRESS;initial catalog=kidsbookoutlet;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />-->
<!--Local DB For Laptop Testing-->
<add name="DBConn" connectionString="data source=LAPTOPDELL\SQLEXPRESS;initial catalog=kidsbookoutlet;integrated security=SSPI;persist security info=True;packet size=4096"/>
<add name="KBODataEntities" connectionString="metadata=res://*/Context.KBODataEntities.csdl|res://*/Context.KBODataEntities.ssdl|res://*/Context.KBODataEntities.msl;provider=System.Data.SqlClient;provider connection string="data source=LAPTOPDELL\SQLEXPRESS;initial catalog=kidsbookoutlet;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"/>
Here's the ssms connection that works.