المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Joining 2 DataSets



C# Programming
01-16-2013, 11:00 PM
Hello all,

I have 2 datasets from 2 different Web Services and reading them into DataSets:

DataSet dsLoans = new DataSet();
dsLoans.ReadXml(XmlReader.Create(new StringReader(myWLSreference.GetCustomLoanExport2())));


DataSet dsCompany = new DataSet();
dsCompany.ReadXml(XmlReader.Create(new StringReader(myWLSreference.GetCustomCompanyExport2())));

I have done multiple searches and have come across:
http://forums.asp.net/t/1708173.aspx/1?how+can+i+inner+join+tables+within+DATASET+[^ (http://forums.asp.net/t/1708173.aspx/1?how+can+i+inner+join+tables+within+DATASET+)]

http://stackoverflow.com/questions/10502512/c-sharp-datatable-inner-join-with-dynamic-columns?lq=1[^ (http://stackoverflow.com/questions/10502512/c-sharp-datatable-inner-join-with-dynamic-columns?lq=1)]

http://support.microsoft.com/kb/326080/en-us[^ (http://support.microsoft.com/kb/326080/en-us)]

But no joy yet. I have searched and searched.

I cant use Datatables because i'm reading the dataset into a List with a foreach statement like so:

foreach (DataRow row in JoinedDataSet.Tables["Loan"].Rows) { WireEntryLoan newEntryLoan = new WireEntryLoan(); newEntryLoan.custName = row["MtgeeLoanName"].ToString(); newEntryLoan.loanWLSID = row["LoanNumber"].ToString();
Then binding that to GridView.

How in the world can I join 2 DataSets on a common field?!