Updating disconnected datasets
The final three lines of our Save code are these: btn Cancel. The whole of the code for your Save button should look like this: Try it out.When you start your programme, click the Add New button to clear the textboxes. When you close down your project and open it up again, the new record should still be there.This contains all the records we pulled from the database, and any amendments we've made.We're handing the whole thing over to the new method, where the Command Builder and Data Adapter will take care of the updates for us.
If your database is not updating, try either Copy if newer or Copy always.) In the next lesson, you'll learn how to update a record, and how to delete a record.
Synced tables cannot be edited in CARTO Builder, as the data is being pulled from another resource.
If you want to edit the dataset, you can disconnect the dataset from the source by altering the sync frequency to Once you change the sync frequency to Never, the sync options are removed and you will not be able sync the dataset.
Add(row); To actually update the database, we need to add a new method to our class. The Data Adapter is linked to the database itself, and can issue Update, Insert and Delete commands.
Of course, we have yet to call our new method into action. Add a try catch statement: try catch (Exception err) For the try part, add the following: try As the first line of the try part, we have this: obj Connect.