SQLDataAdapter.Update problem

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

We have a simple form that has text boxes bound to a
single table/columns. We get the dataset filled okay and
the data displays okay in the text boxes. However when
we change the data in the text box and hit our button
control to update the data (i.e. SQLDataAdapter.Update
(dsName.tableName)) we get nothing ... no error and no
update.

If we put a datagrid in the form and have the datasource
point to the dataset it works fine ... however our
customer requires a form with text boxes.

Certainly appreciate anyone's help/ideas!
 
Hello, Dave.

Try following in your button click event handler:

private void buttonSubmit_Click(object sender, System.EventArgs e)
{
// ensure that current editings are passed to datasource (i.e.,
dataset in our case)
BindingContext[dsName.tableName].EndCurrentEdit();

sqlDataAdapter1.Update(dsName.tableName);
}

This works for me.
 
Make sure you end the current edit first.

BindingContext(DsName, "TableName").EndCurrentEdit()
daName.Update(DsName, "TableName")
 
Brian,
Thanks a bunch! It works ... I'm still a rookie at this
and have been running in circles on this one ... thanks
again!
Dave
 
Back
Top