How do I use DataTable.ImportRow with a DataView

  • Thread starter Thread starter Rob Dob
  • Start date Start date
R

Rob Dob

Hi,

I'm trying to archive orginal records, so what I am trying to do is upon
saving the changed record also writing the orginal record version to a
different table. The problem I'm having is that the DataTable.ImportRow
does not accept a datarowview as a parameter. My code is below, can someone
please let me know how to get around this.. I realise I could iterate
through each colum and build a new datarow, but I'm assuming that there is a
better way.

DataView oDV = new DataView( dataSet1.mytable, "", "",
DataViewRowState.ModifiedOriginal);


foreach (DataRowView DRV in DV)
{
DataSetArchiveRecords oDSAR = new DataSetArchiveRecords();
oDSAR.ArchiveRecords.ImportRow(oDRV);
.........
}
 
DataRowView.Row is the DataRow associated with the DataRowView object.
Is this what you needed?

=====================
Clay Burch
Syncfusion, Inc.
 
Hi,

Thanks for your reply, actually DataRowView.Row returns the current row
version, I need to see the orginal row version before the row was modified,
This way I can archive it..

Any help would be appreciated!!
 
Back
Top