combining datasets

  • Thread starter Thread starter soni2926
  • Start date Start date
S

soni2926

Hi,
I have 2 datasets right now, say with the following structure:
DataSet 1 has a row called ItemCode, index 1
DataSet 2 has a row called ItemCode, index 1

both are similar, but i need to merge them to make one dataset, which
needs to have everything in DataSet1 plus anything from DataSet2
that's not in DataSet1 already. I'm not too familiar with working
with Datasets, i know theres suppose to be a way to join them, can
someone help out? Both have a ItemCode which is what needs to be used
to make sure no duplicates from DataSet2 get into DataSet1.

Thanks.
 
Hi,
Try this code for example:
customers.Merge(orders, True, MissingSchemaAction.AddWithKey)
What you need to take care is there must be primary defined in backend
database(in your case it is itemcode).Also names of tables you are merging in
the dataset must be same.If you take care of this then above code merge
dataset as if join has been done between two tables in dataset
 
Back
Top