DataSet Operations

Adding a new row to the dataSet

public virtual dsRm.rueckm_afoRow RueckmAfo(dsBab.bab_afoRow afoRow)
{
    // prevent the case when datacache is null
    if (this.DataCache == null)
    {
        LoggerSink.PushMessage(this, "busRM.RueckmAfo fehlgeschlagen: TimeLine Data Cache wird geladen! Bitte versuchen Sie es später erneut.");
        return null;
    }
    var row = tSet.rueckm_afo.NewRow();
    row.lfd_nr = ParaUtils.GetNextRueckmAfoLfdNr();
    row.rm_typ = 10; 
    
    row.datum = DateTime.Now;
    row.erstellt_am = DateTime.Now;
     
    //.....         
    
    return row;
}

RowStates:

  • For the operations order New->Add->Initialisation the RowState of the new row will be EditingNew

  • For the operations order New->Initialisation->Add the RowState of the new row will be New

For all RowStates see corresponding chapter.

Deleting a row from the dataSet

Duplicate an existing row

Copy a table

Copy() creates a new DataTable with the same structure and data as the original DataTable.

Ignore change on a column

This is useful when we don’t want to receive a save message when a specific column, that comes from a db compute (not updateable), has changed.

Structure:

Example:

Retrieve on one table

Save

dataSet.SetEditCheckpoint() is used for prevent the possibility that an exception to be thrown. In that case, if SetEditCheckpoint() is not used, the DataBase will return to its previous state, but the DataSet will not.

In conclusion, SetEditCheckpoint() is used for rollbacks to be done on DataSets as well.

Last updated