How do I use DataTable.ImportRow with a DataView

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);
.........
}
 
C

ClayB

DataRowView.Row is the DataRow associated with the DataRowView object.
Is this what you needed?

=====================
Clay Burch
Syncfusion, Inc.
 
R

Rob Dob

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!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top