I have written an application in VB.Net 2010 that requires Sql Server. I have also created an install program that will install SQL Server Express 2008 if it does not find SQL Server. This all works in regards to installing SQL Express if it is needed and SQL Express shows up in my running process. The problem I am having is that I have a routine that will enumerate the servers that are available to this computer but it will not list the SQL Server Express that I just installed. This computer is not connected to a network so it does not know about the instances that are installed on my network. If I connect it to the network it finds the network SQL Servers but not the local one. Can anyone tell me what I'm doing wrong. I have tried this on both Vista and Windows 7 and I have formatted the machine so I know everything is clean. I have included the code that I am using to enumerate the servers below.
Thanks in Advance DC
If lbServers.Items.Count = 0 Then
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
oTable = System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources
For Each oRow As DataRow In oTable.Rows
If oRow("InstanceName").ToString = "" Then
lbServers.Items.Add(oRow("ServerName").ToString & "\" & oRow("InstanceName").ToString)