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



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: Configure Hardware Firewall for SBS 2003
    ... the corresponding ports to the SBS box. ... When a router is deployed at the SBS end, you must forward the port numbers ... TCP 110 This port is used for POP3 mail clients. ... TCP 1723 PPTP VPN connection ...
    (microsoft.public.windows.server.sbs)
  • Re: HTTP DDoS attack on our servers
    ... A quick googling for TCP port 45836 turns up the following page at ... The worm creates a remote access server by listening on TCP ... > Basically,> 8.000 IP numbers are sending HTTP requests to our server on ... > connection after the first sent line, ...
    (Incidents)
  • Re: SQL2005: Cannot connect error 11001
    ... I believe the complete Windows auth user access is too complicate, ... which trusted connection is meant? ... it would still be listening on the old port. ... Microsoft, SQL Server Books Online ...
    (microsoft.public.sqlserver.connect)
  • Re: Installing Sql Server Express on Vista Home Premium
    ... It seems that your SQL Server instances are Named Instances, ... Default Instances uses 1433 TCP port by default as a Static Port but not the ... If you change your Connection String as following, ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL Server 2005 Connection Problems
    ... - it is't completely clear what the SQL Server Browser is for. ... connection reqest was being rejected. ... I think the problem is still likely the the port is blocked by some ... firewall between the server and that client. ...
    (microsoft.public.sqlserver.setup)