If you need to return a
DataSet
, and all you have is a
DataTable
, you can add the
DataTable
to a dummy
DataSet
and return that. Here's an example:
public DataSet DoSomething()
{
DataTable people = GetPeopleWhoMatchSomeCriteria();
DataSet dummySet = new DataSet();
dummySet.Tables.Add(people);
return dummySet;
}
The alternative is to change the return type from
DataSet
to
DataTable
.