Example of Databinding and Updating with SQL

Jun 9, 2009 at 8:57 PM

Does anyone have a working example or know of one that shows how to bind to a SQL DB and update when a cell is edited?



Jun 11, 2009 at 7:37 PM


Jun 11, 2009 at 8:35 PM

I have it binding to a Datatable now all I need to figure out is updating the database when a change is made to a cell and adding / deleting a row. Anyone know how to do this?

Jun 12, 2009 at 1:30 PM

Take a look at this article, http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx.

Jun 15, 2009 at 10:24 PM

I think you'll want to call AcceptChanges on your DataTable or DataRow in your CellEditEnding handler.  See this document for details on commiting changes to your DB.