[Question] Why do I have to move data to another record during update when using textbox to bind data?

Source: Internet
Author: User

The four text boxes are bound to the carno, name, address, and make of tblcustomer (visual binding is used)
The Edit button is used to load data, and the Save button is used to save data. It is very simple and simplified as follows:

Private   Void Btnedit_click ( Object Sender, system. eventargs E)
{
Customerdataset1.clear ();
Sqldataadapter1.fill (mermerdataset1 );
}



Private   Void Btnsave_click ( Object Sender, system. eventargs E)
{
Sqldataadapter1.update (mermerdataset1 );
MessageBox. Show ("Database updated!");
}

However, if I modify the text box and press save to update immediately, there is no error, but there is no update in the database; but if I move to the next record and then press save (only the previous record is modified ), the update is successful. Why?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.