Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 16, 2013 05:10 PM by artvindustries
Jan 15, 2013 08:16 PM|LINK
I have 2 datasets from 2 different Web Services and reading them into DataSets:
DataSet dsLoans = new DataSet();
DataSet dsCompany = new DataSet();
Should I use a primary key to join these DataSets? If so, the PrimaryKey intellisense isn't popping up in my List Method. :(
Jan 15, 2013 08:19 PM|LINK
DataSets do not have access to the .Join() method as most collections in LINQ sadly. It does feature a .Merge() method which might be exactly what you are
looking for as long as the two datasets share the same schema.
Jan 15, 2013 09:40 PM|LINK
If by same schema you are referring to the table structure then no.
<oID>blah</oID> //this is the key i would use to join
Table 2 is:
<cID>blah</cID> //this is the key i would use to join
Can I create a relationship with Merge somehow?
Jan 15, 2013 10:00 PM|LINK
This link might be exactly what you are looking for :
Joining Datasets using LINQ
(Hopefully it's a step in the right direction at least)
Jan 16, 2013 04:52 PM|LINK
Thanks for all your feedback Rion.
Unfortunatley I still haven't been able to Google my problem away. :(
I thought I was close this this solution:
Jan 16, 2013 04:58 PM|LINK
Sorry that you couldn't find an "easy" solution. Here are a few more that might be worth trying
(although I am sure you have seen most of them before)
Inner Joining DataTables in C#
Inner Joining DataTable through a Primary Key
If you are willing to consider a third-party option - you may want to consider looking at
QueryADataSet's library for performing SQL operations on DataSets in C#.
Jan 16, 2013 05:10 PM|LINK
The third party option looks fun! Can't use it as an option though.
I'll keep searchin away. I don't need an easy solution necessarily. I would happily take a more involved route if I had someone to explain in detail how to implement it.