How to Serialize DataTable

D

Drew

Hello-

I have am ASP.Net DataGrid object that I bind to from the result of a
query. In order to not retrieve this dataset again when the user
presses forward and back, I keep the dataset in a session variable:

Session["ID"] = dt;

However, I have learned that if the user does not have cookies
enabled, this does not work. Therefore, I have decided that if the
user does not have cookies enabled I am gong to serialize the
DataTable and save it in the database. Upon return to the page, I
would retrieve the serialized DataTable, un-serialize it and display
it again. I have a few questions:

1. Does anyone know how to serialize a DataTable and then un-serialize
it back to a DataTable when I return to the page?
2. Is there a quick and easy way to determine if the user has cookies
enabled or disabled, which works for IE, Netscape, etc?
3. Does anyone know if there is a better way to do this?

Thank you,

Drew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top