Hot to enumarate SQL servers in my network?

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.
 
D

Dmitry

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.
 
S

Shiva

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top