I have class which has a method that needs to return three DataTables. I thought I could use Generics but honestly I’ve never used them, so I’m trying figure it out. It may not be the right thing here.
I have in my class Employee:
public List<Employee> GetEmployees() { //calls to other methods in my class; //psuedocode GetDataTable1; GetDataTable2; GetDataTable3; return all three datatables; }
On my presentation side I have three gridviews:
I create my class Employee and call GetEmployees and get back my list of DataTable, then
gridview1.datasource = datatable1; gridview2.datasource = datatable2; gridview3.datasource = datatable3;
I’m not sure how to proceed. I have tried the class method definition above but I’m not getting it right.
Hoping for advice. I do not wish to use three methods. I am using C# and asp.net 2.0.
Thank you.
You can add them all to a DataSet and return that