Re: connect to named instance w/ non-default port



As Sylvain stated it might be using a different protocol and tcp may not be enabled on that server. You can use the existing connections event in profiler to see what the connection settings are for each connection or try the activity monitor. And no you should not need the port if you have the right protocol and the browser service is working.

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"John A Grandy" <johnagrandy@g-mail-dot-com> wrote in message news:%23IHX05QvJHA.1240@xxxxxxxxxxxxxxxxxxxxxxx
Hi Andrew, and thanks for the response.

This is an external environment and I have no control over how it is configured ( other than to discover obvious mis-configurations and suggest that they be fixed ). I do not know exactly why this Sql Server listens on a non-default non-fixed port , but "it is the way it is".

My concern is finding a connection string that will allow the .NET SqlConnection.Open() method to connect. From what you are saying , it sounds like there is no need to specify the port number in the connection string. However, I am still not able to connect from .NET ( although SSMS works fine ).

Do you have any suggestions for troubleshooting sql connection strings within .NET ?



"Andrew J. Kelly" <sqlmvpnooospam@xxxxxxxxxxxx> wrote in message news:%23aJ%23DIQvJHA.5484@xxxxxxxxxxxxxxxxxxxxxxx
John,

The SQL Browser service is what resolves the port for you. It listens on port 1434 for SQL Server requests by name/instance and resolves them to the particular port. You can and probably should however fix the port # that the named instance listens on and do not need the browser if you specify that port. Look in BOL under ports [SQL Server] - assigning numbers for details.

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"John A Grandy" <johnagrandy-at-gmail-dot-com> wrote in message news:uDflmaKvJHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
Apparently for named instances which listen
on a non-default port ( i.e. other than 1433 ) , there is no need to specify a port
number in the connection string ( ? )

If so, this is well and good because I am troubleshooting a network where the Sql Server instance is reassigned a new listening port on machine restart.

Indeed , I am able use SSMS to connect to such an instance without
specifying the port number.

However, via my WinForms .NET application using SqlConnection class , the following connection strings do not work.


Data Source=<server name>\<instance name>;Network Library=DBMSSOCN;Initial
Catalog=<db name>;User ID=<user id>;Password=<password>;

Data Source=<server name>\<instance name>,<port number>;Network
Library=DBMSSOCN;Initial Catalog=<db name>;User ID=<user
id>;Password=<password>;


I can connect to the server instance from the client via SSMS and the Sql
Server login used in the connection string ( <user id>/<password> )



I am wondering : what exactly is providing this ability to resolve the
connection request to the correct port number ?

Is it driver/provider dependent ?

Is it configuration dependent ?

Or should it "just work" out of the box for SqlConnection ? ( i.e. I have some other problem going on )


Thanks.






.



Relevant Pages

  • Re: Still cant connect to RWW or OWA remotely
    ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
    (microsoft.public.windows.server.sbs)
  • Re: Still cant connect to RWW or OWA remotely
    ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
    (microsoft.public.windows.server.sbs)
  • RE: VBscript Error on SBS2k3
    ... DHCP Server turned of SonicWALL with VPN Pass through request for IP to ... the problem should be caused by the 4125 port. ... > | Accessories and Communications and Remote Desktop Connection? ... > | 2.In Internet Explorer on the workstation you are connecting from, ...
    (microsoft.public.windows.server.sbs)
  • Re: interfaces lo:1 lo:2 lo:3? (for remote ssh tunnels)
    ... That's the problem tunneling (port forwarding) solves. ... >>can't get past the client firewall. ... > I don't understand why the server would be making the ... server initiates another connection to the client -- in this ...
    (Debian-User)
  • Re: Can not access Web and FTP sites from Internet
    ... your IP Configuration on the Server is correctly. ... Connecting To 12.208.215.87...Could not open connection to the host, ... 1> From the result, we can see the telnet failed, which means the router ... does not forward Port 443 to SBS Server. ...
    (microsoft.public.windows.server.sbs)

Quantcast