Right now I am using the following code to retain information from a single record from a database:
as you can see I am setting each database value to a Session object with the database field as its name. Is there a better way to store these values throughout the life of the Session rather than just setting each one to a separate Session variable?
Code:
for (fieldname=0; fieldname<=SQLReader.FieldCount - 1; fieldname++)
{
Session[SQLReader.GetName(fieldname)] = SQLReader[fieldname];
}
as you can see I am setting each database value to a Session object with the database field as its name. Is there a better way to store these values throughout the life of the Session rather than just setting each one to a separate Session variable?