I am getting the following error when I try to connect to a local SQL Server 2008 Database:
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I understand that it may be a problem with my connection strings:
<add name="sports2connstr" connectionString="Data Source=localhost;Initial Catalog=sports;User Id=Owner;Password=Owner" providerName="System.Data.SqlClient"/>
<add name="sportsconnstring" connectionString="Data Source=localhost;Initial Catalog=sports;User Id=Owner;Password=Owner" providerName="System.Data.SqlClient"/>
I have read different things like:
make sure you give the db rights, and make sure it uses Windows Authentication in connection string...But I don't know how.
I just want to connect to a local version of my db in Sql Server Management Studio 2008 from asp.net on the same box.
Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC) 6.0.6001.18000 (longhorn_rtm.080118-1840)
Microsoft MSXML 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 7.0.6001.18000
Microsoft .NET Framework 2.0.50727.3053
Operating System 6.0.6001