Friday, February 24, 2012

How to get list of all Sql servers on network

Hi,
Is there any function/API in vb to retrieve all the sql servers that are avaiable on a network? Basically, i wanted to implement this facility in my application where users can select a server from list of all avaiable servers on LAN.

Thanks!
Asif.Net, Im having trouble with a couple of the TYPES that are used in the functions.

Have you got this figured out in .NET yet?

Please let me know if you have a resolution.

Thanks,
Malcolm Phillips
Malcolm.Phillps@.prgx.com|||If you get GFI lanscan you'll find there's a script there that enumerates SQL Servers on the network. Its basically VB script but I don;'t have it here at home.

To do it in asp.net I think you'd need to import the SQLDMO namespace|||How do I import the SQLDMO namespace? Please|||You add the Microsoft SQLDMO Object Library as a (COM) Reference to your project, then you add

<%@. Import Namespace="SQLDMO"%>
to your ASP.NET page.

Terri|||Take a look at http://www.extremeexperts.com/sql/faq/SQLDMO-ListServers.aspx for an example ... This works in VB also ...|||Dim mDMOApp As New SQLDMO.Application Dim mNames As SQLDMO.NameList Dim t As Integer mDMOApp = New SQLDMO.Application mNames = mDMOApp.ListAvailableSQLServers() lstServers.Items.Clear() For t = 1 To mNames.Count lstServers.Items.Add(mNames.Item(t)) Next

No comments:

Post a Comment