problem in database using VB 2010

Status
Not open for further replies.

emperror123

Member level 5
Joined
Dec 11, 2010
Messages
86
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,880
dear all

i have do the database but when i debug it, it come out this error which is
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.

i have search many article from google, i still unable to solve it, below are my coding hopefully you all may help me

Code:
       If btnSave.Text = "Save" Then
            '   DateDonatedDateTimePicker.Text = Today
            If SuccessCheckBox.Checked = True Then
                RemarkTextBox.Text = "No Remark"
            End If
            Me.Validate()
            Me.DonorStatusBindingSource.EndEdit()
            frmBlood.DonorInfoBindingSource.EndEdit()
           [SIZE=4] [COLOR=yellow]Me.TableAdapterManager.UpdateAll(Me.PatientDataSet)[/COLOR][/SIZE]
            Me.DataGridView1.DataSource = Me.PatientDataSet.DonorStatus.Select("IC='" & Me.ICTextBox.Text & "'")
            btnCancel.Text = "Back"
            btnSave.Enabled = False
        ElseIf btnSave.Text = "Add" Then
            Me.DonorStatusBindingSource.EndEdit()
            Me.DonorStatusBindingSource.AddNew()
            Me.ICTextBox.Text = frmBlood.txtIC.Text()
            btnSave.Text = "Save"
            btnCancel.Text = "Cancel"
        End If

the yellow highlight is the one place that error occur
 

i offer u to use Linq... easy to use and powerful

put ur project here if its possible.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…