Local connection to SQL Server 2005 Express fails
- From: "TAC" <tac@xxxxxxxxxxx>
- Date: Wed, 29 Nov 2006 15:49:38 -0500
I just installed SQL Server 2005 Express edition, and created an app in
Visual Studio using C#. I get the following error when trying to connect:
"An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)"
I enabled Named Pipes but left TCP/IP disabled because this is a localhost
connection on the same computer.
Here is the portion of the code I am using to connect:
string dbCString = "Persist Security Info=False;Integrated
Security=true;Trusted_Connection=true;Initial
Catalog=MxData;server=(local)";
SqlConnection ThisConnection = new SqlConnection(dbCString);
ThisConnection.Open();
Thanks in advance for any help.
.
- Follow-Ups:
- Re: Local connection to SQL Server 2005 Express fails
- From: Arnie Rowland
- Re: Local connection to SQL Server 2005 Express fails
- Prev by Date: Re: Impossibly remote connections to SQL 2005 express
- Next by Date: Re: Local connection to SQL Server 2005 Express fails
- Previous by thread: Impossibly remote connections to SQL 2005 express
- Next by thread: Re: Local connection to SQL Server 2005 Express fails
- Index(es):
Relevant Pages
|