Update web form

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);
}
 
G

Guest

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);
}
 

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

Top