Hello -
I'm trying to figure out how to step through the DataReader when building a "confirmation page" for my app.
Basically - I'd like to see code to Response.Write the Column Name and the Value of that column..
This record set is only one record, with about 8 columns.
In long hand, it would be:
So, I was wondering what a looped step-though would look like. I often get confused on my loops. I'm guessing that I'm not going to use "FOR...EACH" but rather one with a counter.
Maybe like:
"FOR "blah" to [Count of Columns]"
"Response.Write(dr.GetName(blah))"
Something along those lines? I've very close, I bet, but as a novice, this gets confusing sometimes.
Thanks again!
I'm trying to figure out how to step through the DataReader when building a "confirmation page" for my app.
Basically - I'd like to see code to Response.Write the Column Name and the Value of that column..
This record set is only one record, with about 8 columns.
In long hand, it would be:
Code:
' Open Reader
dr.Read
' Write Column Name
Response.Write(dr.GetName(0) & "<br>")
' Write Column Value
Response.Write(dr.Item(0) & "<hr>")
--- Repeat for all columns in the DataReader ---
So, I was wondering what a looped step-though would look like. I often get confused on my loops. I'm guessing that I'm not going to use "FOR...EACH" but rather one with a counter.
Maybe like:
"FOR "blah" to [Count of Columns]"
"Response.Write(dr.GetName(blah))"
Something along those lines? I've very close, I bet, but as a novice, this gets confusing sometimes.
Thanks again!