I'm stuck on this...
I have included the reference but I keep receiving this error:
An unhandled exception of type 'System.InvalidCastException' occurred in WindowsApplication2.exe
Additional information: QueryInterface for interface SQLDMO.NameList failed.
The code I'm using is this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
Dim oSQLApp As SQLDMO.Application
oSQLApp = New SQLDMO.Application()
Dim oNames As SQLDMO.NameList
oNames = oSQLApp.ListAvailableSQLServers
List1.ClearSelected()
For i = 1 To oNames.Count
List1.Items.Add(oNames.Item(i))
Next i
End Sub
I was successful in making this work in vb.6 but what am I missing in the .NET version.
Thanks.