Joining 2 DataSets
-
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://stackoverflow.com/questions/10502512/c-sharp-datatable-inner-join-with-dynamic-columns?lq=1[^] 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?!
-
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://stackoverflow.com/questions/10502512/c-sharp-datatable-inner-join-with-dynamic-columns?lq=1[^] 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?!
It is only an option, but... You may need to create a third dataset which the relationship itself is defined, and feed it with the information you get from these two webservices. After that, you still can iterate through this third dataset to fill your gridview.