Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- From: "William \(Bill\) Vaughn" <billvaNoSpam@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 09:58:31 -0700
Ah, I think Rick's point is that you should not use/activate TCP/IP for local connections as it forces the client application to navigate through the network stack to get to the server. That's what the shared memory provider does--it bypasses the (considerable) layers when accessing the server instance.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"j.a. harriman" <jeffrey_no_spam_alias@xxxxxxxxxxxxx> wrote in message news:1BDB462D-39F7-4057-9DC4-156A81A093FE@xxxxxxxxxxxxxxxx
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.
- 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\)
- Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- From: j.a. harriman
- .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- Prev by Date: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- Next by Date: SQL Server 2000 TCP Connection Issue
- Previous by thread: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same
- Next by thread: Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same mach
- Index(es):
Relevant Pages
|