Q

What is the method for updating the SQL table from a bound control?

I have a checkbox control on a Windows form. The control is bound to a SQL dataset column as a Boolean. The value from the database is displayed correctly. When the check state is changed and the dataadapter update method is called (after accept changes on dataset is called), no changes are made. When a dataadapter.fill is executed after the update, all original values are returned. No errors are generated. What is the method for updating the SQL table from a bound control? Setting the row and column data manually and the calling update also does nothing. The table only has one row of data.
You should NEVER call AcceptChanges on the dataset! It's exactly THAT method call that is telling the adapter later that there are no changes. The method is called automatically by the adapter upon successfully applying the update.
This was first published in November 2003

Dig deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close