Results 1 to 3 of 3

Thread: dataset

  1. #1
    Join Date
    Dec 1969

    Default dataset

    to what degree can you persist a dataset. do you have to put the dataset in a session variable or write it to XML if you are using it in the scope of one page? i.e. If you create the DS and use it to populate a form, how long can it be referenced? The user changes a value in the datastore, can you compare the current values in the form? Or does it go out of scope as soon as the function that created it closes?<BR><BR>Thanks, Dave

  2. #2
    Join Date
    Dec 1969

    Default IsPostBack

    well, the articles and books say to put your dataset-creating code in between:<BR>If Not Page.IsPostBack<BR>End If<BR><BR>the reason given is that you dont want the resource drain of reloading the dataset again and again when you only need to load it once.<BR><BR>sounds like they are telling us that the dataset persists after the first page load. or perhaps they are just saying that the data has been transfered from the dataset into the user controls and the user controls are what persist between page loads. the only way to tell is to reference the dataset in one of your form-handling subs to see if it throws an error.<BR><BR>i am inclined to think that the dataset dies once it transfers its contents into the user controls, which then persist. but one line of test code in one of your subs will tell you for sure.<BR><BR>does this help? if so, i would appreciate some help on my own open problem, which you can read at:<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: dataset

    The way the data persists is a hidden form field named __VIEWSTATE on the web page.<BR><BR>I don&#039;t know the technical specifics of how a postback uses the __VIEWSTATE value.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts