473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How do I use DataTable.ImportRow with a DataView

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);
.........
}
Mar 29 '07 #1
2 3650
DataRowView.Row is the DataRow associated with the DataRowView object.
Is this what you needed?

=====================
Clay Burch
Syncfusion, Inc.
Mar 29 '07 #2
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!!
Mar 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matthew Wieder | last post by:
I have a datatable as a source and I need to produce a datatable which is all the rows in the original datatable except the first row, copied n times. So, if I had a datatable of: A B C...
3
by: Grey | last post by:
I have create a DataTable in DataSet and I want to have different sorting in this datatable from time to time. Is it possible to sort the data within the datatable, so i can sort the datagrid...
1
by: Ersin Gençtürk | last post by:
I have 2 typed data tables inherited from the same dataset schema One called : table A with an identity column x column x is constrained to be unique. Other one is : table B with an identity...
6
by: Ersin Gençtürk | last post by:
I can't find a expression for table views did i missed something ?
3
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone...
21
by: Sam | last post by:
Hi, The following code : For Each r As DataRow In dtFlow.Rows Dim arow As DataRow = dtAllFlows.NewRow arow = r dtAllFlows.Rows.Add(arow) Next
4
by: hharry | last post by:
hello all, i have 2 datatables and am trying to transfer rows from datatable a to datatable b i use the datatable.importrow method. the importrow method fails (but does not throw an...
1
by: kempshall | last post by:
Hi, I have a question about the .NET DataTable.ImportRow method. If I import a DataRow into an empty DataTable, will the empty DataTable pick up the schema of the DataRow I'm trying to put into...
1
by: tshad | last post by:
I am trying to create a new file from a datatable (not sql server table). I am doing it in this way at the moment: Dim dataTable2 As DataTable = dataTable.Clone drs = dataTable.Select("",...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.