ASP DataSet - Strange problem

  • Thread starter Thread starter mr.Hyde
  • Start date Start date
M

mr.Hyde

Hi,

What happend:
- PageLoad ()
{
dataset.Clear ();
dataadapter.Fill (dataset);
datagrid.BindData ()..
}

Ok,

oButtonClick()
{
changing sql statment
dataset.Clear ();
dataadapter.Fill (dataset);
datagrid.BindData ()..
}

Next

Displayed data is ok, but when I am getting cellvalue - it returns value
from previous query ,
but displayed data is ok ,

for example

datagrid
after fist fill it has 15 records,
after second 5
dataset has 15 and also 15

Please help i dont know what is going on!

Hyde
 
page load is called on the render and the postback. so when the button click
happens, your page load code is overwriting the postback value. use the
handy IsPostback property to control logic in the page load.

if you turn viewstate off, then you must load the grid manually (as a copy
is not saved in viewstate), but it must be done in the OnInit event so that
the generated controls exists to get their postbackdata events.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top