public void Refresh(DataSet ds, IDbCommandBuilder dbCommandBuilder, IDbTransaction dbTransaction) { DataSetTableIterator iterator = new DataSetTableIterator(ds, false); foreach (DataTable dataTable in iterator) { OnRefresh(ds, dbCommandBuilder, dbTransaction, dataTable.TableName); } }
public void Refresh(DataSet ds, IDbCommandBuilder dbCommandBuilder, DbTransaction dbTransaction) { DataSetTableIterator iterator = new DataSetTableIterator(ds, false); DisableAllTableConstraints(ds, dbTransaction); foreach (DataTable dataTable in iterator) { OnRefresh(ds, dbCommandBuilder, dbTransaction, dataTable.TableName, true); } EnableAllTableConstraints(ds, dbTransaction); }
private void insertCommon(DataSet ds, IDbCommandBuilder dbCommandBuilder, IDbTransaction dbTransaction, bool insertIdentity) { Hashtable insertedTableColl = new Hashtable(); DataSet dsSchema = dbCommandBuilder.GetSchema(); DataSetTableIterator iterator = new DataSetTableIterator(dsSchema, true); foreach (DataTable dataTable in iterator) { insertRecursive(ds, dataTable, dbCommandBuilder, dbTransaction, insertedTableColl, insertIdentity); } }
private void deleteCommon(DataSet ds, IDbCommandBuilder dbCommandBuilder, IDbTransaction dbTransaction, bool deleteAll) { Hashtable deletedTableColl = new Hashtable(); DataSet dsSchema = dbCommandBuilder.GetSchema(); DataSetTableIterator iterator = new DataSetTableIterator(dsSchema, true); foreach (DataTable dataTable in iterator) { deleteRecursive(ds, dataTable, dbCommandBuilder, dbTransaction, deletedTableColl, deleteAll); } }
public void Update(DataSet ds, IDbCommandBuilder dbCommandBuilder, IDbTransaction dbTransaction) { DataSet dsCopy = ds.Copy(); dsCopy.AcceptChanges(); DataSetTableIterator iterator = new DataSetTableIterator(dsCopy, true); foreach (DataTable dataTable in iterator) { foreach (DataRow dataRow in dataTable.Rows) { // Modify every table row. dataRow.BeginEdit(); dataRow.EndEdit(); } OnUpdate(dsCopy, dbCommandBuilder, dbTransaction, dataTable.TableName); } }