Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- From: j.a. harriman <jeffrey_no_spam_alias@xxxxxxxxxxxxx>
- Date: Wed, 29 Oct 2008 09:41:04 -0700
Rick,
Thanks for the info - it worked.
If I wanted to specify the port in the conenct string, is my only option to
enable TCP in the surface area configuration?
Thanks.
Jeff
"Rick Byham, (MSFT)" wrote:
Since you are connecting locally and have remote connection disabled you.
should be connecting using shared memory. That's a type of named pipe. But
you are providing a TCP port number (1433). Since you are receiving a TCP
error, the port number must be forcing the client to attempt a TCP
connection -- and you have those disabled. So drop the port number and just
use:
Server=(local);Database=master;Trusted_Connection=True
--
Rick Byham (MSFT), SQL Server Books Online
This posting is provided "AS IS" with no warranties, and confers no rights.
"j.a. harriman" <jeffrey_no_spam_alias@xxxxxxxxxxxxx> wrote in message
news:1DBEF3FC-8DEF-4EFF-8234-857CD6FBAF4E@xxxxxxxxxxxxxxxx
I have been scouring the boards all over and am only finding issues where
people are attempting to remote onto another server to conenct to SQL.
So...
I am on my dev machine and attempting to use the following
ConnectionString
in a C# console app to connnect to the SQL server 2005 DEV/db also on my
dev
machine:
Server=(local), 1433;Database=master;Trusted_Connection=True
and get the following error:
SQL error: 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.
(provi
der: TCP Provider, error: 0 - No connection could be made because the
target
mac
hine actively refused it.)
I am aware of enabling remote connections through the surface area
configuration tool and they are DISABLED, since I do not want to allow
other
servers to connect to my instance.
In an unmanaged C++ app using ODBC (also running on my dev machine), this
connection string works:
DRIVER=SQL
Server;SERVER(local);TRUSTED_CONNECTION=yes;DATABASE=master;APP=myApp
Any reasons why this is happening or how to correct would be appreciated.
Thanks.
- Follow-Ups:
- Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- From: William \(Bill\) Vaughn
- Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- References:
- .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- From: j.a. harriman
- Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- From: Rick Byham, \(MSFT\)
- .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- Prev by Date: SPN's, double hop, and new SSRS 2008.
- Next by Date: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- Previous by thread: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- Next by thread: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- Index(es):
Relevant Pages
|