L
Lee Clements
Hi all,
I am working through a example walkthrough at
http://msdn2.microsoft.com/en-us/library/ms171936(VS.80).aspx to try and
understand how to deal with concurrency issues. The only difference is that
I'm using my own tables, etc. I have used the wizards to create all of the
components and have a datagrid that displays a list of staff records. The
grid also uses two comboboxes linked to two seperate tables within the
dataset to display office rather than office_id and also their
permissions_level.
Everything works ok and when I force a concurrency exception the code fails
when I try to obtain the original datarow by calling Fill on the
TableAdapter.
Private Function GetCurrentRowInDB(ByVal RowWithError As
JPAJobSchedulerDataSet.tblStaffRow) _
As JPAJobSchedulerDataSet.tblStaffRow
Me.TblStaffTableAdapter.Fill(TempCustomersDataTable)
Dim currentRowInDb As JPAJobSchedulerDataSet.tblStaffRow = _
TempCustomersDataTable.FindBystaff_id(RowWithError.staff_id)
Return currentRowInDb
End Function
The error is a contraints error, but I cannot work out which row or
contraint is generating the exception. If I clear the exceptions on the temp
table TempCustomersDataTable before calling the Fill method, then the
exception is bypassed but I then get a problem on the "FindBystaff_id"
method because the primary key is then missing.
Can anyone point me in the right direction to begin debugging this code? I
have tried to look at the exception in more detail with the helpers but I
cannot see anything obvious.
Many thanks in advance for your help
Lee
I am working through a example walkthrough at
http://msdn2.microsoft.com/en-us/library/ms171936(VS.80).aspx to try and
understand how to deal with concurrency issues. The only difference is that
I'm using my own tables, etc. I have used the wizards to create all of the
components and have a datagrid that displays a list of staff records. The
grid also uses two comboboxes linked to two seperate tables within the
dataset to display office rather than office_id and also their
permissions_level.
Everything works ok and when I force a concurrency exception the code fails
when I try to obtain the original datarow by calling Fill on the
TableAdapter.
Private Function GetCurrentRowInDB(ByVal RowWithError As
JPAJobSchedulerDataSet.tblStaffRow) _
As JPAJobSchedulerDataSet.tblStaffRow
Me.TblStaffTableAdapter.Fill(TempCustomersDataTable)
Dim currentRowInDb As JPAJobSchedulerDataSet.tblStaffRow = _
TempCustomersDataTable.FindBystaff_id(RowWithError.staff_id)
Return currentRowInDb
End Function
The error is a contraints error, but I cannot work out which row or
contraint is generating the exception. If I clear the exceptions on the temp
table TempCustomersDataTable before calling the Fill method, then the
exception is bypassed but I then get a problem on the "FindBystaff_id"
method because the primary key is then missing.
Can anyone point me in the right direction to begin debugging this code? I
have tried to look at the exception in more detail with the helpers but I
cannot see anything obvious.
Many thanks in advance for your help
Lee