Exemple #1
0
 public static DataSet QueryDataSet(string _strSql)
 {
     using (HDataBase hDatabase = new HDataBase())
     {
         IDataAdapter iDBAdapter = hDatabase.CreateDBAdapter(_strSql);
         DataSet dsFill = new DataSet();
         iDBAdapter.Fill(dsFill);
         hDatabase.AutoClose();
         return dsFill;
     }
 }
Exemple #2
0
 public static object QueryScalar(string _strSql)
 {
     using (HDataBase hDatabase = new HDataBase())
     {
         using (IDbCommand iCommand = hDatabase.CreateDBCommand(_strSql))
         {
             object oValue = iCommand.ExecuteScalar();
             iCommand.Dispose();
             hDatabase.AutoClose();
             return oValue;
         }
     }
 }
Exemple #3
0
 public static int QueryNonQuery(string _strSql)
 {
     using (HDataBase hDatabase = new HDataBase())
     {
         using (IDbCommand iCommand = hDatabase.CreateDBCommand(_strSql))
         {
             object oValue = iCommand.ExecuteNonQuery();
             iCommand.Dispose();
             hDatabase.AutoClose();
             return (int)oValue;
         }
     }
 }