Writing a winform in the past few days
Queries data on any SQL server in the LAN.
Some problems occurred when calling the COM component sqldmo, which have not been solved
Partial tests Code Using System;
Using System. net. Sockets;
Using System. net;
Using System. text;
Using System. Threading;
Using Sqldmo;
Namespace Leleapplication2
{
/// <Summary>
/// Class1.
/// </Summary>
Class Class1
{
/// <Summary>
/// ApplicationProgram.
/// </Summary>
[Stathread]
Static Void Main ( String [] ARGs)
{
//
// Todo: Add code here to start the application
//
Sqldmo. namelist ns;
Sqldmo. applicationclass rs = New Sqldmo. applicationclass ();
Try
{
NS = Rs. listavailablesqlservers ();
For ( Int I = 0 ; I < NS. Count; I ++ )
{
Console. writeline (NS. Item (I ));
}
}
Catch (exception ex)
{< br> console. writeline (ex. tostring ());
}< P>
}< BR >}< br>
operation failed:
the interface sqldmo is displayed. queryInterface of namelist failed
have you ever written similar programs? Which of the above has a problem? The error line during debugging is