By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,212 Members | 1,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,212 IT Pros & Developers. It's quick & easy.

Updating database via DataGrid

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try

'Stuff

Catch ex As Exception

'Stuff

Finally

'Re-Enable the Button

End Try
OHM

Didymus wrote:
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


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.