Hello,
Even though UpdateNames stored procedure only takes one parameter named @First, we are still able to define additional parameter named Last, and the update will still be successful:
<asp:SqlDataSource ... UpdateCommand="UpdateNames"
UpdateCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="First" Type="String" />
<asp:Parameter Name="Last" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
But when dealing with ObjectDataSource control, the number of parameters defined in ObjectDataSource must exactly match the number of parameters defined in UpdateNames() method. Thus, if UpdateNames() takes only one parameter named First, the following will cause an exception
<asp:ObjectDataSource ... UpdateMethod="UpdateNames">
<UpdateParameters>
<asp:Parameter Name="First" Type="String" />
<asp:Parameter Name="Last" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
A) Why isn’t ObjectDataSource’s matching algorithm as flexible as SqlDataSource’s matching algorithm and thus ignores any extra parameters?
Thank you