I've been seeing some anomalous behavior with the ASP.NET 2.0 formview control, used with the AccessDataSource control, in the Delete capability.

When I have a DeleteCommand that requires a parameter - an ID for the record to be deleted- which I add in the code-behind like this:

Code:
Protected Sub FormView1_ItemDeleting(ByVal sender as object, ETC)
        AccessDataSource1.DeleteParameters.Add("IDNumber", TypeCode.Int32, txtIDNum.Text)
End Sub
Theoretically, I shouldn't have to specify the Delete Parameter in the .ASPX page like this:
Code:
<DeleteParameters>
      <asp:Parameter Name="IDNumber" Type="Int32" />
</DeleteParameters>
Right? I shouldn't have to specify it in the markup because I actually add the whole parameter AND its value in the code-behind.

BUT- That's not the behavior I am seeing-- or rather, I am seeing 2 different things: on some pages, I get an error, or the Delete appears to happen but doesn't, unless I add the <DeleteParameters> tag in the markup. In other pages, I get an error, or the Delete appears to happen but doesn't, if I DO add the tag! And the pages are very similar - pulling from the same table in the same Access database.

Is this just another weird Access inconsistency, or is there a reason I'm missing? I would hate to deploy to the client's server and then start getting errors on half the data access pages...

Can anyone shed some light here??


Thanks,

-Andrew