The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
'_______________________________________
Dim i As Integer
Dim oSQLApp As New SQLDMO.Application()
Dim oNames As SQLDMO.NameList
oNames = oSQLApp.ListAvailableSQLServers
Try
oNames = oSQLApp.ListAvailableSQLServers
Catch
MsgBox(Err.Description)
Exit Sub
End Try
CmbServer.Items.Clear()
For i = 1 To oNames.Count
CmbServer.Items.Add(oNames.Item(i))
Next i
'_________________________________________
this not working. It gives an error saying 'InvaidCastException'.
Kindly help.
Try this it worked on my XP System under SQL 2000 personal server connected to win 2k server with sql 2000.
Dim oSQLDMOApplication, oServersNameList
oSQLDMOApplication = CreateObject("SQLDMO.Application")
oServersNameList = oSQLDMOApplication.ListAvailableSQLServers()
Dim i
For i = 1 To oServersNameList.Count
MyServerNames.Items.Add(oServersNameList.Item(i))
Next i
oSQLDMOApplication = Nothing
The difference between this and your code being the use of create object. When I used NEW I got the same result as you. Hope this helps
Andrew.
> '_______________________________________
> Dim i As Integer
> Dim oSQLApp As New SQLDMO.Application()
> Dim oNames As SQLDMO.NameList
> oNames = oSQLApp.ListAvailableSQLServers
> Try
> oNames = oSQLApp.ListAvailableSQLServers
> Catch
> MsgBox(Err.Description)
> Exit Sub
> End Try
> CmbServer.Items.Clear()
> For i = 1 To oNames.Count
> CmbServer.Items.Add(oNames.Item(i))
> Next i
> '_________________________________________
> this not working. It gives an error saying 'InvaidCastException'.
> Kindly help.
>
JCJohn CosmasDecember 10, 2003 02:09 AM UTC
I had a problem using the oSQLDMOApplication.ListAvailableSQLServers method. My XP box returned a "Object required" message. Please help; I need to somehow enumerate my SQL Servers. The registry method is not very practical because there may be servers not listed in my local registry.
> Try this it worked on my XP System under SQL 2000 personal server connected to win 2k server with sql 2000.
>
> Dim oSQLDMOApplication, oServersNameList
> oSQLDMOApplication = CreateObject("SQLDMO.Application")
> oServersNameList = oSQLDMOApplication.ListAvailableSQLServers()
> Dim i
> For i = 1 To oServersNameList.Count
> MyServerNames.Items.Add(oServersNameList.Item(i))
> Next i
>
> oSQLDMOApplication = Nothing
>
> The difference between this and your code being the use of create object. When I used NEW I got the same result as you. Hope this helps
> Andrew.
>
> > '_______________________________________
> > Dim i As Integer
> > Dim oSQLApp As New SQLDMO.Application()
> > Dim oNames As SQLDMO.NameList
> > oNames = oSQLApp.ListAvailableSQLServers
> > Try
> > oNames = oSQLApp.ListAvailableSQLServers
> > Catch
> > MsgBox(Err.Description)
> > Exit Sub
> > End Try
> > CmbServer.Items.Clear()
> > For i = 1 To oNames.Count
> > CmbServer.Items.Add(oNames.Item(i))
> > Next i
> > '_________________________________________
> > this not working. It gives an error saying 'InvaidCastException'.
> > Kindly help.
> >
>