Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add CSV export from a DataTable (HTML)
Message
From
20/08/2005 23:25:31
 
 
To
20/08/2005 16:07:38
General information
Forum:
ASP.NET
Category:
Web forms
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01041954
Message ID:
01042538
Views:
22
>SNIP
>If you want to do it server-side using a DataTable, you can:
>- re-create the DataTable in the Export method
>- persist the DataTable from an earlier method, and use that
>
>If the latter, I agree with Bonnie, using Session state is one way to persist the DataTable e.g.
// In the method that originally creates the DataTable:
>Session["MyDataTable"] = dt;
>
>// In your Export method:
>DataTable dt = (DataTable)Session["MyDataTable"];
>// need to explicitly cast the Session object back to a DataTable
You'll have to decide if saving the DataTable in Session state is reasonable (not too large, won't hang around too long) and also remember to destroy it when you're finished with it.


Thanks. It was the latter one, about Session state as Bonnie said. I knew all the previous ones. :)


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform