Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make DataSet, DataView in scope on posting back
Message
De
11/11/2008 17:58:22
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01361193
Message ID:
01361194
Vues:
16
>Hi,
>
>I was wondering. Say you have a DateSet (and table and view) created in the PAGE_LOAD method under condition of
>
>
>if (!Page.IsPostBack) 
>
>
>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 can save it to session:

Session("MyData") = dsMyData

and retrieve as needed:

dsMyData = DirectCast(Session("MyData"), DataSet)

I have shown VB version. I think C# is

Session["MyData"] = dsMyData

and

dsMyData = (dataSet)Session["MyData"]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform