Пример #1
0
 public object ExecuteScalar(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     object ret = cmd.ExecuteScalar();
     return ret;
 }
Пример #2
0
 public int ExecuteNonQuery(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     int ret = cmd.ExecuteNonQuery();
     return ret;
 }
Пример #3
0
 public DbDataReader ExecuteReader(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     DbDataReader reader = cmd.ExecuteReader();
     DataTable dt = new DataTable();
     return reader;
 }
Пример #4
0
 public DataTable ExecuteDataTable(DbCommand cmd, Trans t)
 {
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     DbProviderFactory dbfactory = DbProviderFactories.GetFactory(dbProviderName);
     DbDataAdapter dbDataAdapter = dbfactory.CreateDataAdapter();
     dbDataAdapter.SelectCommand = cmd;
     DataTable dataTable = new DataTable();
     dbDataAdapter.Fill(dataTable);
     return dataTable;
 }