473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

dataset disappears on postback

i have a dataset object i put on my webform, i fill the dataset, bind it to my grid. the grid displays with my data. i put a button with no code in it, but just to have it force a postback. every time this happens, my dataset is set to nothing

for the fun of it, i created 2 datasets and left one of them 'untouched', meaning it wasn't bound to anything... just filled with data. sure enough, it reset to "nothing" on a postback. this is causing all kinds of problems for me and i have no idea why. there is no good reason for it to happen... nowhere in code is it reset

any ideas?
Nov 18 '05 #1
3 1850
The server doesn't keep a webform running all the time. It loads the worm
upon client request, runs it and then unloads. The next client causes the
form to get loaded again. The form doesn't remember anything about the
previous run unless you take special care about it. On every postback you
have to populate your dataset again and to re-bind to the grid.

Eliyahu

"jhill" <an*******@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
i have a dataset object i put on my webform, i fill the dataset, bind it to my grid. the grid displays with my data. i put a button with no code in
it, but just to have it force a postback. every time this happens, my
dataset is set to nothing.
for the fun of it, i created 2 datasets and left one of them 'untouched', meaning it wasn't bound to anything... just filled with data. sure enough,
it reset to "nothing" on a postback. this is causing all kinds of problems
for me and i have no idea why. there is no good reason for it to happen...
nowhere in code is it reset.
any ideas?

Nov 18 '05 #2
oh my... this is scary. every time a person clicks any button or does any interaction, i need to reload all of the data. that's going to be incredibly inefficient. is there a way to store the dataset in a session variable or something like that? i really only need it for the existing page, so is there any way to make some kind of global variable or page variable that will maintain for the current session, while on that current page

i've read that storing datasets as a session variable may not work for some reason?
Nov 18 '05 #3
You could hang on to the dataset by storing it in a ViewState or Session
State object (both have +s & -s).
"jhill" <an*******@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
oh my... this is scary. every time a person clicks any button or does any interaction, i need to reload all of the data. that's going to be
incredibly inefficient. is there a way to store the dataset in a session
variable or something like that? i really only need it for the existing
page, so is there any way to make some kind of global variable or page
variable that will maintain for the current session, while on that current
page?
i've read that storing datasets as a session variable may not work for

some reason?
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Babu Mannaravalappil | last post by:
(This is a cut-and-paste) of one of my previous posts. Since I did not get any help, I thought may be I should re-post it anew. Sorry!!) Environment: Visual Studio Enterprise 2003 DotNET 1.1...
4
by: Filippo Pandiani | last post by:
I have a grid that shows the file list from a folder. On the postback, how do I get a Dataset from this grid? Thanks, Filippo.
0
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
3
by: Guadala Harry | last post by:
I have a simple user control (see below) that has EnableViewState="true". I place it on an ASPX page at runtime using a PlaceHolder - which also has EnableViewState="true". After a postback, the...
2
by: Kiran | last post by:
Hi, This is something weird I noticed recently in ASP.Net. I have created typed dataset and I have filled the data. when a postback happens, the data of the dataset is lost. Is there a...
12
by: Dave | last post by:
I'm relatively new to ASP and .NET and having trouble getting my head round this. I want to read a datset from a database, and display information from one row at a time, using a Next and a...
10
by: Suzi | last post by:
I am creating a windows app and I use the data adapter wizard to generate a SQL query. Once the data adapter is created, I generate a dataset from it and my dataset appears in the designer. Then I...
5
by: Corno | last post by:
Hi all, If I want to provide a typed dataset from a webservice and if that dataset has relations that are nested (isNested=True), then the relations(keyrefs) are not available in the XSD that is...
2
by: Vishal Gupta | last post by:
Hi all, I have a placeholder control on an ASPX page. I dynamically add a few button control and label control to the placeholder from code - all is well with the world. But on post back the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.