SQL DMO in .NET

  • Thread starter Thread starter LIN
  • Start date Start date
i tried it out. its giving all the classes
but when I am using the ListAvailableSQLServers() the result should be in
NameList
I am not able to use the NameList, Bcoz .Net Wrapper Class tells that it is
an Interface.

Need Advice

LIN
 
I've programmed C# and VB .NET program against SQL DMO via COM Interop. It
works great. I personally don't think Microsoft would try to rewrite SQL DMO
piece into pure .NET code. Maybe wait until Yukon. :-)
 
Hi,

try classes starting _ eg SQLDMO._Database.

LIN said:
i tried it out. its giving all the classes
but when I am using the ListAvailableSQLServers() the result should be in
NameList
I am not able to use the NameList, Bcoz .Net Wrapper Class tells that it is
an Interface.

Need Advice

LIN
 
hi oj,

i'm using .NET v1.0, i have had problems.
I get an error stating: "QueryInterface for interface SQLDMO.NameList
failed."
on this partilcular line:


Dim sqlApp As New SQLDMO.Application()
Dim NL As SQLDMO.NameList, index As Long

NL = sqlApp.ListAvailableSQLServers '<<this line>>
For index = 1 To NL.Count
Console.WriteLine(NL.Item(index))
Next



Please advice.

cheers,
LIN
 
This works just fine in .NET v1.0.

Dim sqlApp As New SQLDMO.Application()
Dim NL As SQLDMO.NameList, index As Int32 'Use INT32 instead of
LONG.

NL = sqlApp.ListAvailableSQLServers
For index = 1 To NL.Count
Debug.WriteLine(NL.Item(index))
Next
sqlApp = Nothing
NL = Nothing

Also, be sure to "IMPORTS SQLDMO".

--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net



LIN said:
hi oj,

i'm using .NET v1.0, i have had problems.
I get an error stating: "QueryInterface for interface SQLDMO.NameList
failed."
on this partilcular line:


Dim sqlApp As New SQLDMO.Application()
Dim NL As SQLDMO.NameList, index As Long

NL = sqlApp.ListAvailableSQLServers '<<this line>>
For index = 1 To NL.Count
Console.WriteLine(NL.Item(index))
Next



Please advice.

cheers,
LIN


oj said:
Here is a quick demo...

--
-oj
Rac v2.2 & QALite!
http://www.rac4sql.net


LIN said:
i tried it out. its giving all the classes
but when I am using the ListAvailableSQLServers() the result should be in
NameList
I am not able to use the NameList, Bcoz .Net Wrapper Class tells that
it
is
 
Back
Top