I have a datareader names SQLReader. Is it Possible to say something like this in C#:
I am returning only a single row in the datareader and want to loop through each field and set the Session variable name to the fieldname then set the value to the value of the row returned.
Code:
foreach (FieldName description in SQLReader)
{
Session[description] = SQLReader[description].ToString()
}
I am returning only a single row in the datareader and want to loop through each field and set the Session variable name to the fieldname then set the value to the value of the row returned.