Getting the Number of Running SQL Instances running in Network in VB.NET

Posted by Initiotech under Others category on | Views : 3867
This code sample can be used to get the number of SQL Instances running in your Network.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s As Sql.SqlDataSourceEnumerator
s = Sql.SqlDataSourceEnumerator.Instance
Dim dt As DataTable = s.GetDataSources()
DataGridView1.DataSource = dt
End Sub

I have used the DataGridView to display the SQL Instances Details

P.S : Dont Forget to
Import System.Data

Hefin Dsouza

Comments or Responses

Login to post response