SQLDMO Problem

  • Thread starter Thread starter Faraz Rasheed
  • Start date Start date
F

Faraz Rasheed

I am getting the InvalidCastException with the
message 'QueryInterface for interface SQLDMO.NameList
failed' when i try to access the ListAvailableSQLServers()
method of SQLDMO.Application class


SQLDMO.Application objSQLDMOApp = new
SQLDMO.ApplicationClass();

// populating the combo box with available servers
SQLDMO.NameList servers =
objSQLDMOApp.ListAvailableSQLServers();
for(int i=0; i<servers.Count; i++)
{
cbxServer.Items.Add(servers.Item(i));
cbxServer.SelectedIndex = 0;
}

What is the problem in the code?
 
Faraz,
What is the problem in the code?

The problem isn't in your code, it's a SQLDMO bug. To fix it, download
and install the latest SQL service pack on the client.



Mattias
 
Back
Top