Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi everybody,
I hope I'm missing something really simple here and hope that you guys can help me out.
I'm writing a C# application that connects to a local database (service-based database), in this database I obviously have several tables and also one view which shows different parts of three tables.
In the application itself I'm showing (and editing/updating) the tables in a bunch of DataGridViews. The editing and subsequent updating of the tables is no problem, so far so good. However in one of my DataGridViews im not accesing a table directly but instead showing the view mentioned above. Displaying the information that is already in the databse is no problem, however when I edit data there, I seem not to be capable of updating the underlying tables. I presume this should be relativly simple to accomplish, but I seem to be missing something.
The way I update all of the other tables would be:
myTableAdapter.Update(myDataSet.MyTable)

How can I do something comparable with the view?
Posted

1 solution

If the DataGridView displaying the View was bound to a BindingSource and the BindingSource was bound to the Database, it should update automatically but can be prompted to do so by use of the BindingSource.ResetBindings[^] method.

Hope this helps. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900