Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }