data deleted from dataset

I have an ASP.NET application that is loosing the data in the datatables in a dataset after the initial load of the page. The tables are created in the dataset but they contain no records. I am trying to update the dataset on the Click event handler for one of the buttons on the page. Does any body have any ideas Thanks.

Answer this question

data deleted from dataset

  • projecttoday

    If your data not bound to the control, like DataGrid, then viewstate will not keep it. It is just a variable that will be disposed. You need to provide some sort of mechanism to keep it alive if you do not do binding

  • nullsmind

    Do you see the data in a DataTables during initial loading of the page first time If yes, then DataTable probably disposed between calls because you might not have a mechanism in your code that keeps datatable on a server side or ViewState is disabled (depending on what you trying to do)

  • ozan celikada

    The data is present at the end of the Page_Load() method. I concur that the data is getting disposed but, I don't know what is causing that. The ViewState is enabled on the web form. The ViewStatMac is NOT enabled. Thanks.
  • data deleted from dataset