Re: .NET SqlConnection: connect error SQL Server 2005 DEV on same



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.

.



Relevant Pages

  • Re: Looking for program that emails me when dhcp addr changes
    ... For SSH all you need forwarded is TCP Port 22... ... >>participate in TCP connections or UDP conversations it initiates but ...
    (comp.security.ssh)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... connections need to be returned to the pool to be ... Enterprise version of SQL Server 2000. ... server user login to be sure that it is not mixed with other running clients). ... Every new client opens again 30 connections if I open 30 tables ...
    (microsoft.public.sqlserver.connect)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... an Access database in former times this was a lot of work which took me ... closed connections - but all of these errors are in the version which used ... the SQL Server 2000 and everything worked ... client for programming easy, fast and good applications. ...
    (microsoft.public.sqlserver.connect)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... I wonder if the XP/Vista limit of 10 connections on a non-server system is playing a role here? ... Hitchhiker's Guide to Visual Studio and SQL Server ... "William Vaughn " wrote: ... > the default port for the default instance. ...
    (microsoft.public.sqlserver.connect)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... I think it will ameliorate the situation if you clean up the client as ... And to come back to my problem: I think with help of the SQL Server admins ... closed connections - but all of these errors are in the version which used ... Every new client opens again 30 connections if I open 30 tables ...
    (microsoft.public.sqlserver.connect)