ObjectDataSource paging SelectMethod more than two parameters error

ObjectDataSource paging SelectMethod more than two parameters error

Post by emailcu.. » Thu, 26 Jan 2006 01:31:50



Hello,  I am trying to use display data into GridView using
objDataSource (without a business layer).  The code works fine when
EnabledPagin="false", however if it's true I get the following error:

" ObjectDataSource 'objDataSource' could not find a non-generic method
'GetDocumentsByFolderIDPaged' that has parameters: maximumRows,
startRowIndex. "

Can someone show me how I can pass in three parameters onto
objDataSource's selectMethod?

------------------------------------------------------------------------------------------------------------------------------------------------------------------
code fragment:
*FileUploaderDataAccessTableAdapters.DocumentsTableAdapter is defined
in the .xsd file
------------------------------------------------------------------------------------------------------------------------------------------------------------------
<asp:GridView ID="FUGridView" SkinID="gridSkin1" runat="server"
        AllowPaging="true" PageSize="5"
        DataKeyNames="FolderID,FileName" DataSourceID="objDataSource"
        AutoGenerateDeleteButton="true" AutoGenerateColumns="false" >
   <Columns>
.......</asp:Gridview>

<asp:ObjectDataSource ID="objDataSource" runat="server"
        EnablePaging="true"
TypeName="FileUploaderDataAccessTableAdapters.DocumentsTableAdapter"
        StartRowIndexParameterName="startRowIndex"
MaximumRowsParameterName="maximumRows"
        SelectMethod="GetDocumentsByFolderIDPaged"
OnSelected="objDataSource_selected"
        SelectCountMethod="GetDocumentsCountByFolderID"
        FilterExpression="FolderID='{0}'"
        ConvertNullToDBNull="true">
            <filterparameters>
                <asp:ControlParameter Name="cpFolderID"
ControlID="ddlViewOptions"
                    PropertyName="SelectedValue" />
            </filterparameters>
    </asp:ObjectDataSource>
-------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL:
------------------------------------------------------------------------------------------------------------------------------------------------------------

AS

BEGIN

WITH ResultList AS (
        SELECT ROW_NUMBER() OVER (ORDER BY DateUploaded DESC) AS Row,
                                        FolderID, Image, FileName, UserID
        FROM            DocLibrary

)

SELECT  FolderID, Image, FileName, UserID
FROM ResultList

END

 
 
 

1. objectDataSource paging with parameters

Hello ladies and gentlemen,

Say I have an objectDataSource, a SQL stored procedure that SELECT the

SelectMethod in the objectDataSource, and if I enable paging, how do I
setup the maximumRows parameter in my business layer.  I keep getting
the error

" ObjectDataSource 'objDataSource' could not find a non-generic method
'GetDocumentsByFolderIDPaged' that has parameters: maximumRows,
startRowIndex. "

I am trying to avoid in using FilterExpression or <filterparameters>.

Thanks.

2. Tooltips in wedit

3. Fwd: multiple parameter passing in crystal report in asp.net i have two parameter(ANSWER)

4. VO & Faxserve

5. multiple parameter passing in crystal report in asp.net i have two parameter

6. How much memory.....

7. Error message when opening page two times on the same time

8. How to pass variables between two different pages lying on two different servers

9. Best way to pass parameters/arrays from page to page as opposed to the same page

10. how to use first page textbox in second page in asp.net

11. Hide the parameter that is passed from aspx page to aspx page