Mike_Stevens
asked on
List available SQL Servers using VB.NET
I am looking for a reliable way to search for all available SQL Servers on a network. I then need to be able to list the databases for a particular server. I have done this in the past in VB6 applications using SQLDMO without problem. I am wondering if their is a better or different way to do this using VB.NET and the .NET Framework version 3.5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried the second methid you just posted. It works but it is very, very slow
How big is your network, out of curiousity? The server enum takes about 10 seconds for me, but we only have around 200 workcenters.
Using the first method, you will just get the SQL server names available. Once you 'weed out' the non-server machines, you can then run the stored procedure 'sp_databases' against the servers to enumerate the db's.
Using the first method, you will just get the SQL server names available. Once you 'weed out' the non-server machines, you can then run the stored procedure 'sp_databases' against the servers to enumerate the db's.
Dim dtSQL As New DataTable
dtSQL = Sql.SqlDataSourceEnumerato
DataGridView1.DataSource = dtSQL.AsDataView
This should query your network for all available instances of SQL server 2000 or 2005.