Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Saving changes in DataGridView
 

Saving changes in DataGridView

Assuming DataGridView is getting data from a datatable. How do I save the changes a user made on a DataGridView? Can someone point me to some sample code. Thanks.
HKEC  Wednesday, April 11, 2007 12:04 AM

Hi,

If you want to save changes ,add following code in you form and it should work fine, i think.

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs ) Handles btnSave.Click

Me.DetTableAdapter.Update(Me.Database1DataSet)

End Sub

For more information,take at these articles

DataGridView - doing update/add/delete - MSDN Forums

saving the data entered in the datagridview to database table - MSDN ...

Hope it helps.

Regards

Gavin Jin - MSFT  Wednesday, April 11, 2007 1:01 AM

Hi,

If you want to save changes ,add following code in you form and it should work fine, i think.

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs ) Handles btnSave.Click

Me.DetTableAdapter.Update(Me.Database1DataSet)

End Sub

For more information,take at these articles

DataGridView - doing update/add/delete - MSDN Forums

saving the data entered in the datagridview to database table - MSDN ...

Hope it helps.

Regards

Gavin Jin - MSFT  Wednesday, April 11, 2007 1:01 AM

Hi,

I have a windows test project, C#, with one datagridview, tableadapter and dataset. The datagrid view is bound to the dataset. I have implemented the method datatabpe.update(dataset), but the changes done on the datagridview simply don't get to the database. so that next time I open the application, I don't see the changes.

I have tried other methods suggested in forums, but without any success up to now.

Can someone point me to simple step by step instructions how to make this work.

Thank you.

prak_msforum  Tuesday, March 25, 2008 5:39 PM

You can use google to search for other answers

Custom Search

More Threads

• Datagridview not adding row to bound datatable
• Clicking on datagridview causes Vista home to report "program stopped responding".
• Datagridview dirty ????
• user profiles in gridview
• Can't hide first column in DataGridView
• C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help!
• Use of DataGridViewCheckBoxColumn.IndeterminateValue
• RowHeaderCell Change Selected Row Image
• Interacting with Flash Movie from .Net Application C#
• Help with RadioButton properties