Ejemplo n.º 1
0
 public void CloseCon()
 {
     try
     {
         if (asO != null && asO.IsAlive)
         {
             asO.AbortOperation();
         }
         asO = null;
     }
     catch { }
     try { StopTimer(); }
     catch { }
     try { DoBeforeClose(); }
     catch { }
     try
     {
         if (cn != null && cn.State != ConnectionState.Closed)
         {
             cn.Close();
         }
     }
     catch { }
     cn = null;
     GC.Collect();
 }
Ejemplo n.º 2
0
 protected void OpenConnection(string connectionString)
 {
     CloseCon();
     this.curConStr = connectionString;
     asO            = new AsyncConnectionOpener(connectionString);
     asO.DoOpen(ConnectionOpened);
 }