Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make DataSet, DataView in scope on posting back
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01361193
Message ID:
01361300
Views:
9
>And I want this DataSet to be in "scope" (or available) when the page is posted back (that is in the condition of ELSE, what should I do?
>
>I can make the DataSet and Table and View to be a property of the page but that does not solve the problem. Because on the post back the DataSet has nothing.
>
>What is the solution to this?
>
>Thank you in advance for any suggestions.

You've already gotten some feedback about saving into the user's session (which works). Your ASP.NET pages are created and destroyed on a per-hit basis (stateless) so you have to think about restoring it's state via some other means. Session is one way, Viewstate is another, and finally just reloading the data from the database on an as-needed basis.

If you're storing the information in the Session, one thing to keep in mind is the number of records you are storing vs the number of users of the site. For most business apps., this isn't really a big deal since the number of users is usually fairly low (assuming you're not pulling down a huge table into memory). But if you've got a large number of users, serializing a large DataSet and storing into the session may not always be the best idea. Sometimes it's just better to reload the data from the database on each hit. There isn't really a hard and fast rule, since each of these have issues (for example, accessing the database is usually the slowest thing happening on a given page, so it might not scale particularly well).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform