Hello experts,

Currently I'm stuck in a situation in which I need to copy a record
from one dataset
to another. Can anyone help me out with this?

My goal is to loop through a dataset and check if a certain field
meets a criterion,
if there's a match, that record goes through another dataset. Here's
what my code looks like:

 DataSet dsRenewal  = new DataSet();
 DataSet dsNewActive    = new DataSet();
...

 foreach (DataRow dr in ds.Tables["TBL_MFQueryResult"].Rows)
 {
     if (dr["MF_TYPE"] == '0')       //  '0' means its a renewal, '1'
New Active and so on...
     {
       dsRenewal.Tables[0].Add(ds.Tables["TBL_MFQueryResult"].Rows
[?].ItemArray);  // huh?
     }
    else if (dr[...])
    {
      dsNewActive.Tables[]....
    }
   ...

 }


Cheers!


Benj



Reply via email to