Based on your queries, you need to specify the
original_Member
parameter twice for both the
UpdateParameters
and the
DeleteParameters
.
<asp:AccessDataSource ID="memberPointsSource" runat="server"
ConflictDetection="CompareAllValues" DataFile="../app_data/SimpleQSet.mdb"
DeleteCommand="DELETE FROM [Points] WHERE (([Member] = ?) OR ([Member] IS NULL AND ? IS NULL)) AND (([Points] = ?) OR ([Points] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [Points] ([Member], [Points]) VALUES (?, ?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [Member], [Points] FROM [Points]"
UpdateCommand="UPDATE [Points] SET [Points] = ? WHERE (([Member] = ?) OR ([Member] IS NULL AND ? IS NULL)) AND (([Points] = ?) OR ([Points] IS NULL AND ? IS NULL))"
>
<DeleteParameters>
<asp:Parameter Name="original_Member" Type="String" />
<asp:Parameter Name="original_Member" Type="String" />
<asp:Parameter Name="original_Points" Type="Int32" />
<asp:Parameter Name="original_Points" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Member" Type="String" />
<asp:Parameter Name="Points" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Points" Type="Int32" />
<asp:Parameter Name="original_Member" Type="String" />
<asp:Parameter Name="original_Member" Type="String" />
<asp:Parameter Name="original_Points" Type="Int32" />
<asp:Parameter Name="original_Points" Type="Int32" />
</UpdateParameters>
</asp:AccessDataSource>
Access uses positional parameters, not named parameters. Therefore, if the query uses the same parameter twice, you need to add it to the parameters collection twice. And the order in which you add the parameters needs to precisely match the order in which the query uses them.