SQL SMO problems RRS feed

  • Question

  • I am using SQL SMO to run a query on a SQL 2000 DB. I am doing this--->

    ServerConnection objSQLServerConnection;
    Server objServer;

    objSQLServerConnection = new ServerConnection(@strServerName, userName, passwd);
    objServer = new Server(objSQLServerConnection);

    //check if database exists
    Database objDatabase = objServer.Databases[strDatabase]; -----Problem here..

    if (objDatabase == null)
        // no such database exists --return with error
    When it executes the problem statement, the Debugger hangs and never returns. I guessed this had to do it "Function Evaluation timed out" problem. However, implementing the suggested things does seem to help. Anybody any help? Thanks.
    Thursday, July 19, 2007 10:06 AM