G
Guest
I have a code snippet that searches for available SQL Server Instances on the
network and returns the instance Name(s). (See Bill Vaughn's comments in
"Finding Instances of SQL Server for DropDownList" below - it's a great demo
of new .NET 2.0 features).
I have found that in some cases the connection will fail if I assign the
value of Name to DataSource in the connection string but will succeed if I
use the IP address of the named instance instead.
(Actually, when I use the Name in the connection string an error is
returned: "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. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)". This is odd because the connection opens
correctly when I use the IP address instead of the instance Name.)
To work around this (until I figure out the above problem), I was hoping
that there was a way to resolve the IP address from a SQL Server instance
Name.
network and returns the instance Name(s). (See Bill Vaughn's comments in
"Finding Instances of SQL Server for DropDownList" below - it's a great demo
of new .NET 2.0 features).
I have found that in some cases the connection will fail if I assign the
value of Name to DataSource in the connection string but will succeed if I
use the IP address of the named instance instead.
(Actually, when I use the Name in the connection string an error is
returned: "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. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)". This is odd because the connection opens
correctly when I use the IP address instead of the instance Name.)
To work around this (until I figure out the above problem), I was hoping
that there was a way to resolve the IP address from a SQL Server instance
Name.