I'm using mysql database..I have forms setup main form has datagrid..you can add to this datagrid and save to datbase with my add form and it works fine. I can delete from the datagrid and it works fine...when I select an account to edit is when I have my issue...form edit brings up the selected account but when I save my changes it doesn't save to the selected account it changes my first account in the database...Help...here is a sample of my code
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
' 'Save changes to database and exit
Dim intResponse As String
intResponse = MsgBox("Do you want to SAVE Changes to this record?", vbOKCancel, "Save?")
If intResponse = vbOK Then
PbCustomerDS.customer(0).Address_Line1 = Address_Line1TextBox.Text
PbCustomerDS.customer(0).Location = LocationTextBox.Text
PbCustomerDS.customer(0).Attention = AttentionTextBox.Text
PbCustomerDS.customer(0).City = CityTextBox.Text
PbCustomerDS.customer(0).State = StateTextBox.Text
PbCustomerDS.customer(0).Zip = ZipTextBox.Text
PbCustomerDS.customer(0).Phone = PhoneMaskedTextBox.Text
PbCustomerDS.customer(0).Bill_To = Bill_ToTextBox.Text
PbCustomerDS.customer(0).Attention_2 = Attention_2TextBox.Text
PbCustomerDS.customer(0).B_address = B_addressTextBox.Text
PbCustomerDS.customer(0).B_City = (B_CityTextBox.Text)
PbCustomerDS.customer(0).B_State = B_StateTextBox.Text
PbCustomerDS.customer(0).B_Zip = B_ZipTextBox.Text
PbCustomerDS.customer(0).B_Phone = B_PhoneMaskedTextBox.Text
PbCustomerDS.customer(0).Comments = CommentsTextBox.Text
PbCustomerDS.customer(0).Updated = UpdatedLabel1.Text
Me.Validate()
Me.CustomerBindingSource.DataSource.GetType()
Me.CustomerBindingSource.EndEdit()
Me.CustomerTableAdapter.Update(PbCustomerDS)
Me.TableAdapterManager.UpdateAll(PbCustomerDS)
Me.Close()
End If
If vbCancel Then
Exit Sub
End If
End Sub
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
can someone please help me with my issue?