SelectCountMethod using SelectParameters in 3.5

Discussion in 'ASP .Net' started by Aconquija, Dec 7, 2007.

  1. Aconquija

    Aconquija Guest

    I am having an issue with the SelectCountMethod of the ObjectDataSource
    using .net framework 3.5. What I need to do is pass the following
    SelectParameters to my SelectCountMethod in order to filter my result as they
    are filtered in the SelectMethod:

    <asp:QueryStringParameter QueryStringField="cat" Type="String"
    Name="Category" />
    <asp:QueryStringParameter QueryStringField="brand"
    Type="String" ConvertEmptyStringToNull="true"
    Name="Brand" />

    My ods is as follows:
    <asp:ObjectDataSource ID="odsItems" runat="server"
    SelectCountMethod="getItemsCount" SelectMethod="getItems" EnablePaging="true"

    My function is:
    Public Function getItemsCount(ByVal Category As String, ByVal Brand As
    String,) As Integer

    I keep getting the following error:
    ObjectDataSource 'odsItems' could not find a non-generic method
    'getItemsCount' that has parameters: Category, Brand.

    Has anything changed in 3.5 to prevent this from working, or am I
    misunderstanding something? Thanks in advance...
    Aconquija, Dec 7, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.