Question Updating Database from DataGridView

tim8w

Active member
Joined
Oct 26, 2010
Messages
38
Programming Experience
5-10
I have a DataGridView that was created using the wizard. I made a change to one of the column's data and I want to save the changes back to the database. Here's the simple code:

VB.NET:
Me.WHVMastersUniverseTableAdapter.MastersOnHold(Me.PreManfDataSet.WHVMastersUniverse)
dgvMasters.AutoResizeColumns()
For iIndex = 0 To dgvMasters.RowCount - 2
    dgvMasters.Rows(iIndex).Cells("Status").Value = "On-Hold"
Next iIndex
Me.WHVMastersUniverseTableAdapter.Update(Me.PreManfDataSet.WHVMastersUniverse)

I don't get any erros but the 'Status' is not saved in the database...
 
I don't get any erros but the 'Status' is not saved in the database...

How EXACTLY are you determining that? What value does Update return? If it's not 0 then data is being saved. In that case, follow the first link in my signature for information how local data files are managed.
 
Back
Top