How to save edits to a data bound table or query (ultra basic)

35 views Asked by At

It's been many years since I've done much programming, and now I'm trying to do a pro bono project for a local library. Relearning everything!

I can't get edits to save.

I have a DataGridView and a BindingNavigator bound to a table, Titles. I also have controls bound to individual fields of this table. I have a save button on the navigator and call "this.titlesTableAdapter.Update(this.libraryDataSet.Titles)" on click. The program thumbs its nose at me ;-(

I got this code from https://learn.microsoft.com/en-us/visualstudio/data-tools/update-data-by-using-a-tableadapter?source=recommendations&view=vs-2022&tabs=csharp

I've also visited multiple websites, youtube, and a Udemy course. It seems to be automatic for everyone else. Why, oh why, do the programming gods hate me?

My program is Windows Forms running against an Access back end. I am using VS Community 2022.

Also, my recollection is that best practices call for binding to a query rather than a table, particularly since I am joining several tables (only fields -- including foreign keys -- in the Titles table need to be updated). False memory? If a query is the right approach, does this change my Update code?

0

There are 0 answers