Ejemplo n.º 1
0
 public bool Test()
 {
     try
     {
         db.CreateConnection().Open();
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
     finally {
         db.CreateConnection().Close();
     }
     return(true);
 }
Ejemplo n.º 2
0
 private object ExecuteScalarScript(DBDatabase db, DBScript script, bool supportsMultipleStatements)
 {
     if (supportsMultipleStatements)
     {
         return(db.ExecuteScalar(script));
     }
     else
     {
         object value = null;
         using (System.Data.Common.DbConnection con = db.CreateConnection())
         {
             con.Open();
             foreach (DBQuery q in script)
             {
                 value = db.ExecuteScalar(con, q);
             }
         }
         return(value);
     }
 }