I have a problem where I want to return the results of several data requests to report out in a table (in the UI, I'll use a repeater).
Normally in this situation I would just use cmd.Fill(myDataset, "tablename") for each data request, and return the dataset to the calling page.
However this time the individual rows in each table share a common link. I want to report them out one row at a time each. That is the first row in my UI will list out the first row in each of my dataset tables (4 of them).
Also to complicate the matter, I need to do this for 5 different groups of data requests. I don't think I can have a method return 5 datasets, so I'd like to use a naming scheme to differentiate between the 5 groups' tables.
Is this code appropriate to fill the table with data from the request and then add that table to the dataset:
Code:
Dim myTable As New DataTable
cmd.SelectCommand.CommandType = CommandType.StoredProcedure
cmd.SelectCommand.CommandText = "sp_GetMyData"
cmd.Fill(myTable)
cmd.Fill(result, "myTable")
(cmd being a SqlDataAdapter)
The page should look like this:
tbl1 tbl2 tbl3 tbl4
---- ---- ---- ----
category1 28 17 9 11
category2 19 22 10 8
category3 37 0 2 17
.
.
.
where vertically (tbl1, 2, etc) are shown the results of data requests (totals for each category), and there will be 4 more of these tables.
Thanks in advance!
- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.