I wouldn't clone.
I'd do this
mydataset dsAllData = new mydataset();
mydataset dsPotentiallyGoodDS = new mydataset();
mydataset dsBadData = new mydataset();
Loop over dsAllData
when an error occurs then do this
for each alldatarow in dsAllData.Select("");
mydataset.mytable.myrow badrow = dsBadData.mytable.Newmyrow();
badrow.a = alldatarow.a;
//continue on all properties
dsBadData.mytable.Addmyrow( badrow );
next alldatarow
something like that.. the syntax will be wrong.
The key is..... add a NEW row to the bad dataset or potentiallGood dataset
as you encounter them.
...
"P K" <PK@discussions.microsoft.com> wrote in message
news:19**********************************@microsof t.com...
Hi,
I have 3 datasets
d1Main is the main dataset having rows.
I loop through rows in d1main and any row failing validations is moved to
d2Bad dataset. I had to clone d2bad as d1main and then add failed row to
d2bad
so d2bad is created out of d1main.
Now comes d3good. any records valid in d1main are moved to d3good. again
this was done by cloning d1main for d3good.
Now i use d3good to update the database. The moment database error occurs.
I have to move row in d3good to d2bad.
Moving is failing as it says row already exists. Already d3good is cloned
out of d1main. I cannot clone it again out of d2bad.
how do I do this??