Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

I can't get my DataGridView control to update an SQL table

$
0
0

I have built the most simple example of a DataGridView that I can. It is a form with a DataGridView that is bound to a single table in my SQL database. When the application run, it populates the datagrid and appears to let the user update fields on the form. However, no updates are sent to the SQL database. I know because I ran a trace on the SQL server and there are no transactions after the data is fetched. The datasource was created using the Visual Studio GUI and the boxes to allow editing, adding  and deleting are checked. There are no errors, the updates are just thrown away when the application ends.

Is there code that must be added to the generated to code cause the updates to be sent back to the SQL database? I've tried adding a few things to force saving the changes and so far, nothing has worked. I thought the DataGridView default code properly handled both the fetching and updating of records, is this incorrect? I am working with Visual Studio 2012.


Walter of Mardovar


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>