Updating database via DataGrid

  • Thread starter Thread starter Didymus
  • Start date Start date
D

Didymus

Hi everyone,

My program reads data from a DataBase, then populates some ComboBoxes with
data from each Table respectively, filtering the data in each ComboBox
according to the item selected in the preceding ComboBox.
(...Thanks guys for the guidance in that area...)

The resulting filtered table displays the filtered result in a DataGrid.

I want to be able to edit any errors found in the text displayed. (This part
works).
I set the DataGrid to Enable the Update button when the cell is clicked.
I then have the Update button set itself to Enabled=False after performing
the Update.

Then problem is at this point. If I click the Update button, and then find
another error in the text, I can not get the Update button to Enabled=True
again.

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpdate.Click

'Update the DataBase

Try

daText.Update(dsText)

Catch ex As Exception

MsgBox(ex.ToString)

End Try

btnUpdate.Enabled = False

End Sub

Private Sub dgText_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dgText.Click

'Enable the Update button

btnUpdate.Enabled = True

End Sub


Thanks in advance,

Gary
 
Try

'Stuff

Catch ex As Exception

'Stuff

Finally

'Re-Enable the Button

End Try


OHM
 
Back
Top