I have created a webservice which returns two datasets(return type) as results.
Is it possible to combine two datasets results into one so that I can display it on one datalist? I try using arraylist
but it returns nothing in datalist
.
GetDepartureFlightsDetails()
and getDepartureFlights()
both returns a dataset values.
Below is the method i use to retrieve the webservice results.
public ArrayList GetDepartureFlightsDetails(String departurecountry, String arrivalcountry, DateTime departuredate)
{
DLSA datalayerTS = new DLSA();
DLJS datalayerJW = new DLJS();
ArrayList array = new ArrayList();
array.Add(datalayerSA.GetDepartureFlightsDetails(departurecountry, arrivalcountry, departuredate));
array.Add(datalayerJW.getDepartureFlights(departurecountry, arrivalcountry, departuredate));
return array;
}
You can use the DataSet.Merge method:
firstDataSet.Merge(secondDataSet);
Update:
public DataSet GetDepartureFlightsDetails(String departurecountry, String arrivalcountry, DateTime departuredate)
{
DLSA datalayerTS = new DLSA();
DLJS datalayerJW = new DLJS();
var firstDataSet = datalayerSA.GetDepartureFlightsDetails(departurecountry, arrivalcountry, departuredate));
var secondDataSet = datalayerJW.getDepartureFlights(departurecountry, arrivalcountry, departuredate));
firstDataSet.Merge(secondDataSet);
return firstDataSet;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With