2
votes

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

1
Are you sure your 2008 R2 (not the same as 2008!) Express instance isn't named SQL2008TEST? That's what it would appear to me. - Aaron Bertrand
No, this is the named instance that I installed - Furqan Sehgal
Ok, can you show a screen shot of the SQL Server services pane in SQL Configuration Manager? Maybe there is a bug in SqlDataSourceEnumerator but 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
Are you saying you also have 2008 installed and it's not showing up? SQL Server Builds - Tim Lehner

1 Answers

5
votes

Make sure that:

  1. The instance you are looking for is actually installed (see SQL Server Configuration Manager > SQL Server Services)
  2. That the instance is started (same place)
  3. That the SQL Browser service is running (Control Panel > Administrative Tools > Services)
  4. That the port that SQL Server is running on isn't blocked via firewall or other means
  5. That the instance isn't set to be hidden (you can see this in SQL Server Configuration Manager > SQL Server Network Configuration > Right-click "Protocols for [name of your instance]"):

enter image description here