Unless your connection supports multiple readers (SQL-Server 2005?),
then do what it says and use a second connection. Alternatively,
arrange your data so that it can all be read with a single reader; e.g.
return one grid with both the parent and child data (switching parent
when you spot e.g. a primary key change value), or return multiple
grids, one per parent; personally, I tend to return a single parent
grid and a single child grid, e.g.)
ParentID, ParentColumn1, ParentColumn2,...
10012,x,x,x
12041,x,x,x
ParentID, ChildID, ChildColumn1, ChildColumn2,...
10012,14411,y,y,y
10012,14134,y,y,y
12041,12452,y,y,y
etc
DataReaders can almost all handle multiple grids.
Marc
|