I have an ObjectDataSource control like this:
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" EnablePaging="True"
MaximumRowsParameterName="maxRow" SelectCountMethod="howMuch"
SelectMethod="getData" StartRowIndexParameterName="startRow"
TypeName="BusinessObject">
</asp:ObjectDataSource>
and a class BusinessObject like this:
public class BusinessObject
{
public someTyp[] getData(int maxRow, int startRow)
{ /* some code */ }
public int howMuch()
{ /* some code */ }
}
I added parameters maxRow, startRow for getData method manually and it works well with GridView. Next, I'm using "Configure Data Source..." Task from ObjectDataSource visual designer. The option for SELECT is: getData(Int32 maxRow, Int32 startRow), returns someTyp[] and it's OK, but the next step is to configure these parameters, and the result is SelectParameters are added to ObjectDataSource:
<SelectParameters>
<asp:Parameter Name="maxRow" Type="Int32" />
<asp:Parameter Name="startRow" Type="Int32" />
</SelectParameters>
and it doesn't work now. I get exception telling that there is no method howMuch() with parameters Int32 maxRow, Int32 startRow.
And my question is, why parameters maxRow, startRow aren't excluded from parameter's list for SelectCountMethod despite the fact that they are set as MaximumRowsParameterName and StartRowIndexParameterName. Shouldn't they be omitted as they are set as paging parameters?
Thanks.