DataSet across more than 1 page

  • Thread starter Thread starter Ryu
  • Start date Start date
R

Ryu

Is there any way to share a DataSet across more than 1 page? Do I have to
retrieve the same Dataset everytime I go to a new page? Please advice,
thanks
 
Ryu said:
Is there any way to share a DataSet across more than 1 page? Do I have to
retrieve the same Dataset everytime I go to a new page? Please advice,

You can store a DataSet or other object in Session state. In Page 1:

Session("myDataSet") = myDataSet

in Page 2:

myDataSet = DirectCast(Session("myDataSet"), DataSet)
 
you will find this helpfull :

use a base class and inherit your pages that share the same dataset from
this base class
and put a code like this :

public dsListe.FiyatTalepDataTable SessionFiyatTalep
{
get
{
dsListe.FiyatTalepDataTable temp
=(dsListe.FiyatTalepDataTable)Session["fiyattalebi_dsEliste_fiyattalep"];
if (temp==null)
{
return(new dsListe.FiyatTalepDataTable());
}
return(temp);
}
set
{
Session["fiyattalebi_dsEliste_fiyattalep"]=value;
}
}

rgrds,
ersin
 
Yes, it does.

Just because it is ASP.NET does not mean that it magically remembers
object data without using hardware. Datasets are heavy objects to
store, as well. Ryu might want to try just storing the tables that are
needed, and not the dataset.

Any time something is stored in session, resources are used. Datasets
have a lot more excess garbage than DataTables do, which makes storing
them in session iffy.

ASP.NET in IIS 5 (not 6) still stores state in a single process. It's
separate from the IIS process, stability is improved, but there still
are issues.
 
Mike Newton said:
Yes, it does.

Just because it is ASP.NET does not mean that it magically remembers
object data without using hardware. Datasets are heavy objects to
store, as well. Ryu might want to try just storing the tables that are
needed, and not the dataset.

Any time something is stored in session, resources are used. Datasets
have a lot more excess garbage than DataTables do, which makes storing
them in session iffy.

Please provide us a link to some research on this.
ASP.NET in IIS 5 (not 6) still stores state in a single process. It's
separate from the IIS process, stability is improved, but there still
are issues.

ASP.NET stores session state in the same process, in another stateserver
process, or in SQL Server, depending on configuration. If there are issues,
please elaborate upon them.

In particular, the most serious issue with ASP session state is not present
in the case of storing a DataSet in ASP.NET: there are no COM threading
issues.
 
Ersin Gençtürk said:
you will find this helpfull :

use a base class and inherit your pages that share the same dataset from
this base class
and put a code like this :

public dsListe.FiyatTalepDataTable SessionFiyatTalep
{
get
{
dsListe.FiyatTalepDataTable temp
=(dsListe.FiyatTalepDataTable)Session["fiyattalebi_dsEliste_fiyattalep"];
if (temp==null)
{
return(new dsListe.FiyatTalepDataTable());
}
return(temp);
}
set
{
Session["fiyattalebi_dsEliste_fiyattalep"]=value;
}
}

The above works as a practical matter, but is problematic in terms of
design. An inheritance hierarchy should exist because of the logical
relationships between the classes, and not based on implementation issues
like which classes share a dataset.
 
Back
Top