Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
how to update database in batch according to changes in wingrid?
posted

Hi guys.

I have a dataset that binded into a wingrid. And I need to update the database in batch.

I thought of compare the dataset data with the wingrid data, but I failed to loop all the rows in the wingrid.

Another that I thought of is put a flag to indicate whether the row is updated or not. But same, I failed to loop all the rows.

Is there any option that I can use to get all the rows that get updated?

Thanks.

Parents
No Data
Reply
  • 3565
    Verified Answer
    posted

    Updating your database is not going to have anything to do with the WinGrid. The WinGrid is just a front end for the user. All the changes made in the WinGrid and being pushed back into your dataset. If you want to get all the changes made in your dataset you could use the GetChanges method on the dataset object to get a new dataset with only updating being made plus some other records if necessary in order to maintain referencial integrity. Or you can check the RowState property of your data rows to see if they have been modified. But that would be the hard way of doing it. You should be using a table adapter.

    As far as updating the data in batch that all depends on the capabilities of the backend database you are using. But it sounds like you should try normal updating first before you get into batch updating.

Children