B
Brian Henry
Anyone know why this would happen... I added a reference to the SQLDMO COM
object, imported it on top of my code.. then this test code fails
Imports SQLDMO
Module Module1
Sub Main()
Dim i As Integer
Dim oNames As SQLDMO.NameList
Dim oSQLApp As SQLDMO.Application
oSQLApp = New SQLDMO.Application
oNames = oSQLApp.ListAvailableSQLServers()
For i = 1 To oNames.Count
Console.WriteLine(oNames.Item(i))
Next i
End Sub
End Module
the error is "An unhandled exception of type 'System.InvalidCastException'
occured in ConsoleApplication1.exe Additional informaiton: QueryInterfacefor
interface SQLDMO.NameList failed."
I had this working in the past, but now it wont work. What could be wrong?
object, imported it on top of my code.. then this test code fails
Imports SQLDMO
Module Module1
Sub Main()
Dim i As Integer
Dim oNames As SQLDMO.NameList
Dim oSQLApp As SQLDMO.Application
oSQLApp = New SQLDMO.Application
oNames = oSQLApp.ListAvailableSQLServers()
For i = 1 To oNames.Count
Console.WriteLine(oNames.Item(i))
Next i
End Sub
End Module
the error is "An unhandled exception of type 'System.InvalidCastException'
occured in ConsoleApplication1.exe Additional informaiton: QueryInterfacefor
interface SQLDMO.NameList failed."
I had this working in the past, but now it wont work. What could be wrong?