public Form1(){InitializeComponent();}DataTable dataTable;public void GetSQLInstances(){System.Data.Sql.SqlDataSourceEnumerator instance = System.Data.Sql.SqlDataSourceEnumerator.Instance; dataTable = instance.GetDataSources();if (dataTable.Rows.Count > 0){InstancesInformation();}}private void InstancesInformation(){ foreach (System.Data.DataRow row in dataTable.Rows){listBox1.Items.Add(row[0] + " " + row[1] +" "+ row[2] + " " + row[3]);} }private void button1_Click(object sender, EventArgs e){GetSQLInstances();}...........
public Form1()
{
InitializeComponent();
}
DataTable dataTable;
public void GetSQLInstances()
System.Data.Sql.SqlDataSourceEnumerator instance = System.Data.Sql.SqlDataSourceEnumerator.Instance;
dataTable = instance.GetDataSources();
if (dataTable.Rows.Count > 0)
InstancesInformation();
private void InstancesInformation()
foreach (System.Data.DataRow row in dataTable.Rows)
listBox1.Items.Add(row[0] + " " + row[1] +" "+ row[2] + " " + row[3]);
private void button1_Click(object sender, EventArgs e)
GetSQLInstances();
...........