for (int i=0; i<dataset.Tables.Count; i++) {
Response.Write(dataset.Tables[i].TableName);
Response.Write("\n");
// loop rows
for (int j=0; j<dataset.Tables[i].Rows.Count; j++) {
// loop columns
for (int k=0; k<dataset.Tables[i].Columns.Count; k++) {
Response.Write(dataset.Tables[i].Rows[j][k].ToString());
if (k < dataset.Tables[i].Columns.Count - 1) {
Response.Write(", ");
}
}
Response.Write("\n");
}
Response.Write("\n");
}
this isn't exactly what you want, but idea.|||If the procedure returns a fixed number of result sets, you can return the results a datareader and then bind each result set to something like a datagrid or a repeater using .nextresult between bindings. A datareader can hold more than one result set. It can be pretty handy.
No comments:
Post a Comment