Update web form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have problem updating a web form.
Unfortunely when i edit one of the feilds and press the button, it loads the
old data back without any change !! I be happy if some one help me fix this
update problem.Thanks

I use the wizard for generating sqlconnection, sqladapter and dataset.
AutoPostBack is set to true for all fileds
EnableViewState is set to true for all fileds

Here is some code:

private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
sqlSelectCommand1.Parameters["@ID"].Value = Request.QueryString["id"];
sqlDataAdapter1.Fill(dataSet11);
TextBox1.DataBind();
....
}
private void Update_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.Update(dataSet11);
}
 
I wish a had this example http://www.developerfusion.co.uk/show/3801/6/, but
for a WEB FORM, not a grid......

CJ said:
I think the problem is the state(viewstate or session) of the form.

CJ said:
Have problem updating a web form.
Unfortunely when i edit one of the feilds and press the button, it loads the
old data back without any change !! I be happy if some one help me fix this
update problem.Thanks

I use the wizard for generating sqlconnection, sqladapter and dataset.
AutoPostBack is set to true for all fileds
EnableViewState is set to true for all fileds

Here is some code:

private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
sqlSelectCommand1.Parameters["@ID"].Value = Request.QueryString["id"];
sqlDataAdapter1.Fill(dataSet11);
TextBox1.DataBind();
...
}
private void Update_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.Update(dataSet11);
}
 
Back
Top