Hot to enumarate SQL servers in my network?

  • Thread starter Thread starter Dmitry
  • Start date Start date
D

Dmitry

Hi.
I'm interesting how to enumerate available SQL servers in the network from
code in C#. It may be done in C++ using WINAPI function NetServerEnum. If
there is no way except importing this function from DLL, help to write C#
declarations please.
Thanks.
 
http://www.codeproject.com/cs/database/LocatingSql.asp

HTH

Hi.
I'm interesting how to enumerate available SQL servers in the network from
code in C#. It may be done in C++ using WINAPI function NetServerEnum. If
there is no way except importing this function from DLL, help to write C#
declarations please.
Thanks.

Hi.
Thanx. Now I realized how to use NetServerEnum. But just a little
question... NetServerEnum searches only servers in my domain. Why Query
Analizer shows more SQL servers and even serves that do not belong to my
domain? How does it work?
Thanks for advices.
 
This sample uses ODBC32.DLL API:
http://www.codeproject.com/cs/database/LocatingSql.asp

http://www.codeproject.com/cs/database/LocatingSql.asp

HTH

Hi.
I'm interesting how to enumerate available SQL servers in the network from
code in C#. It may be done in C++ using WINAPI function NetServerEnum. If
there is no way except importing this function from DLL, help to write C#
declarations please.
Thanks.

Hi.
Thanx. Now I realized how to use NetServerEnum. But just a little
question... NetServerEnum searches only servers in my domain. Why Query
Analizer shows more SQL servers and even serves that do not belong to my
domain? How does it work?
Thanks for advices.
 
Back
Top