I am running following code to get all the versions of SQL Servers installed and the instances installed.
Dim sqldatasourceenumerator1 As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance
datatable1 = sqldatasourceenumerator1.GetDataSources
The code works fine. I have both SQL Server 2005 Express and 2008 installed.
The instances it shows
Server Name: Instance Is Clustered Version
SUPERCOMPUTER SQLEXPRESS No 9.00.3042.00
SUPERCOMPUTER CBE No 9.00.5000.00
SUPERCOMPUTER SQL2008TEST No 10.50.1600.1
I wonder why it does not show the default instance of SQL Server 2008, like it shows for 2005 (SQLEXPRESS)
Thanks

SqlDataSourceEnumeratorbut I suspect it is more likely that what is installed on the server is not exactly what you think is installed. Also validate that the SQL Browser service is running, and that the instance you're expecting to show up isn't set to not broadcast. - Aaron Bertrand