Results 1 to 6 of 6

Thread: [2.0] List of SQL Srevers

Threaded View

  1. #1

    Thread Starter
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    Smile [2.0] List of SQL Srevers

    well, i try to get the sql server list on my network
    getting the names of the servers using c#
    and here is what i done:
    i added a refrance to use SQLDMO
    here is the code i used to get the servers list
    Code:
    SQLDMO.Application fApp = new SQLDMO.ApplicationClass();
    SQLDMO.NameList nl = (SQLDMO.NameList)fApp.ListAvailableSQLServers();
                foreach (string strServer in nl)
                {
                    MessageBox.Show(strServer);
                }
    this was the code and this was the Error Message that I get

    Code:
    Unable to cast COM object of type 'System.__ComObject' to interface
     
    type 'SQLDMO.NameList'. This operation failed because the QueryInterface 
    call on the COM component for the interface with IID '{10022406-E260-11CF-
    AE68-00AA004A34D5}' failed due to the following error: No such interface 
    supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    can ay one help me? thanks alot
    Last edited by avrail; Apr 4th, 2007 at 12:33 PM.
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    my blog : http://refateid.blogspot.com/
    twitter :@avrail
    010011000111010101110110001000000100110101111001001000000101000001100011

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width