|
-
Feb 9th, 2003, 01:31 AM
#1
Thread Starter
New Member
ADO.NET Update Operation
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?
Grant Carmichael
www.evanced.net
-
Feb 9th, 2003, 10:06 AM
#2
New Member
well because the data set doesn't see that row was modified , it is still in memory I had the same issue you do,
must change the row
So if you only have 1 record u need to change it to EOF or BOF
Other wise just click another record for the dataset to see the field has bee modifed then u can update
hope it helps
Stupid people need to do us a favor and shut-up
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|