How to use the ListAvailableSqlServers in c#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is my code:

///////////////////////////////////////////////////////////////////////////
SQLDMO._Application SqlServer = new ApplicationClass();
try
{

SQLDMO.NameList servers = SqlServer.ListAvailableSQLServers();

for(int i=0;i<servers.Count;i++)
MessageBox.Show(servers.Item(i));

}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}



///////////////////////////////////////////////////////////////////////////
The compiler tell me : Queryinterface is failed of the SQLDMO.NameList

What shall I do ?
 
Time to install the SQL client from the latest SP for SQL server 2000.

Willy.
 
I have read your article about the SQL-DMO at your web site ,And I tried
your code in my program ,but the
same error occured ,Can you tell me why ?
Error :Queryinterface is failed of the SQLDMO.NameList
 
I have read your article about the SQL-DMO at your web site ,And I tried
your code in my program ,but the
same error occured ,Can you tell me why ?
Error :Queryinterface is failed of the SQLDMO.NameList
 
This is a known problem, solved a couple of years ago with a SP for SQL2000.

Willy.
 
Back
Top