Using SqlDataSourceEnumerator.GetDataSources Method, I can search the available SQL Server instances on my intranet. On the MSDN help, it says that this method will return a DataTable object that has information about visible/available SQL Server instances, and this includes the SQL Server's Version information.
If the instances of SQL Server is on a firewalled computers that have Windows XP SP2 firewall or Windows Server 2003 SP1 firewall, the Datatable could not return the InstanceName and Version information. I've tried to make exceptions to the Windows Firewall by opening TCP port for SQL Server, port #1046 and #1433. I've searched MS KB and still can't fix it. If I turn off the firewall, I can retrieve full Instance name and Version information.
Here's my code: (I dump the display to a ComboBox)
private void btnQuerySQLDB_Click(object sender, EventArgs e)
{
//
SqlDataSourceEnumerator sqlenum = SqlDataSourceEnumerator.Instance;
dtsql = sqlenum.GetDataSources();
comboBox1.Items.Clear();
foreach (DataRow row in dtsql.Rows)
{
comboBox1.Items.Add(row["ServerName"] + "\\ " + row["InstanceName"] + " (" + row["Version"] + ")");
}
}
Is this a bug or are there any workarounds Please help.

SqlDataSourceEnumerator.GetDataSources can't return the Instance name and Version information on firewalled computers
MikeBarta411
Is there anything more to do
Please help.
Bob Briggs
Here you go:
http://msdn2.microsoft.com/en-us/library/ms165724.aspx
WS_progger_starter
macv3x
Azalela, is this port number is documented
CsharpDotnetDeveloper
Kay2live
Sukh