0

I'm loading data from multiple xml files with different schemas into DataSets. I do have foreign key style relationships between the tables in each xml file but to date they're only enforced by code. I need to access data coming from multiple files and display it in a DataGridView.

Is there a way to merge the data from multiple files into a single DataSet?

Alternately can I write linq to dataset queries across multiple DataSets?

1 Answers1

1

Perhaps the DataSet.Merge() method will help you out? You can simply load the files as you're currently doing, and merge them together.

womp
  • 115,835
  • 26
  • 236
  • 269
  • If I'm correctly understanding the MSDN documentation that's for combining stuff with the same schema, not for packing two sets with different schemas into the same container. – Dan Is Fiddling By Firelight Dec 09 '09 at 03:55
  • Dan, the DataSet.Merge() is used to merge two DataSet objects that have largely similar schemas. I think your way out of this problem is to build your own tool that understands both schemas and build in the proper rules for merging those. – El Padrino Aug 05 '11 at 11:43