joh*_*nny 0 asp.net generics datatable list
我有一个类,它有一个方法需要返回三个DataTables.我以为我可以使用Generics但老实说我从来没有使用过它们,所以我正在尝试解决它.这可能不是正确的事情.
我班上的员工:
public List<Employee> GetEmployees()
{
//calls to other methods in my class;
//psuedocode
GetDataTable1;
GetDataTable2;
GetDataTable3;
return all three datatables;
}
Run Code Online (Sandbox Code Playgroud)
在我的演示文稿方面,我有三个网格视图:
我创建了我的类Employee并调用GetEmployees然后返回我的DataTable列表
gridview1.datasource = datatable1;
gridview2.datasource = datatable2;
gridview3.datasource = datatable3;
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么办.我已经尝试过上面的类方法定义,但我没有把它弄好.
希望得到建议.我不想使用三种方法.我正在使用C#和asp.net 2.0.
谢谢.