Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataset only fills from one page and not on another

Status
Not open for further replies.

saroyal

Programmer
Jul 3, 2002
30
0
0
GB
I have a dataset that only seems to fill with records on one page only, namely the page I was in when I clicked on "generate dataset". I can put the dataset in another page but after using dataadapter.fill(dataset) the dataset is always empty.

The is 99% the same on both pages, the only difference is that the paramater value (in the select command of the dataadapter) is different on both pages.

The select command does return records when I use a datareader so I cannot understand what I am doing wrong.

Any advice would be very much appericated.

Simon
 
sar: Have you consider putting the DataSet in Cache, or in Session, or even passing it as a QueryString and rebuilding it?
 
Simon, Isa is right... Don't forget that once your page fully loads, the Dataset object disappears. This is due to the stateless nature of web pages. If you want to get access to the data again, you must either (1) reconstruct the Dataset object again, or (2) save the Dataset before it is destroyed into Cash or Session variables.

If you're creating a new and fresh Dataset on both pages, then you have a different problem. In that case, please post your code so that we could look at it and try to see what's going on...

Hope this helps!

JC

We don't see things as they are; we see them as we are. - Anais Nin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top