grantc2
Feb 9th, 2003, 12:31 AM
As an example, I have one combobox and a textbox on a form. The textbox is bound to a row in a DB table. I can run the app and when I select an item in the combobox, the textbox is filled with the respective data. I used:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.BindingContext(DsCustomerFullName1, "customer").Position = ComboBox1.SelectedIndex
End Sub
I have a label on the form with this procedure to update changes:
Private Sub lblUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblUpdate.Click
If Not DsCustomerFullName1.GetChanges(DataRowState.Modified) Is Nothing Then
adapterFullName.Update(DsCustomerFullName1.GetChanges(DataRowState.Modified))
MsgBox("Changed!")
End If
End Sub
Now, when I run the app, I can change the data in the textbox and click Update. However, I don't get my MsgBox prompt. Hence my data not being updated. Does this make since? Any suggestions?
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.BindingContext(DsCustomerFullName1, "customer").Position = ComboBox1.SelectedIndex
End Sub
I have a label on the form with this procedure to update changes:
Private Sub lblUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblUpdate.Click
If Not DsCustomerFullName1.GetChanges(DataRowState.Modified) Is Nothing Then
adapterFullName.Update(DsCustomerFullName1.GetChanges(DataRowState.Modified))
MsgBox("Changed!")
End If
End Sub
Now, when I run the app, I can change the data in the textbox and click Update. However, I don't get my MsgBox prompt. Hence my data not being updated. Does this make since? Any suggestions?