示例#1
0
 public bool KillDB(string dbName)
 {
     SQLDMO.SQLServer svr = new SQLDMO.SQLServerClass();
     try
     {
         svr.Connect(ServerName, UserName, Password);
         svr.KillDatabase(dbName);
         return(true);
     }
     catch (Exception err)
     {
         //throw (new Exception("!" + err.Message));
         ShowError("删除数据库失败!" + err.Message);
         return(false);
     }
     finally
     {
         svr.DisConnect();
     }
 }
示例#2
0
 public bool KillDB(string dbName)
 {
     SQLDMO.SQLServer svr = new SQLDMO.SQLServerClass();
     try
     {
         svr.Connect(ServerName, UserName, Password);
         svr.KillDatabase(dbName);
         return true;
     }
     catch (Exception err)
     {
         //throw (new Exception("��" + err.Message));
         ShowError("ɾ�����ݿ�ʧ��!" + err.Message);
         return false;
     }
     finally
     {
         svr.DisConnect();
     }
 }