Exemplo n.º 1
0
 public bool connect(DatabaseConfiguration config)
 {
     bool flag = false;
     if (config != null)
     {
         this.Config = config;
     }
     if (this.CreateConnectionUrl())
     {
         try
         {
             this.DbConnection = ConnectionManager.checkOutConnection(this.ConnectionUrl.ToString(), this.Config.getMaxConnections());
             flag = (this.DbConnection != null) && (this.DbConnection.State == System.Data.ConnectionState.Open);
         }
         catch (Exception exception)
         {
             this.error.message = "Couldn't connect to the database.";
             this.error.info = exception.ToString();
         }
     }
     return flag;
 }