Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
I was trying to use objectDataSource with gridview, but was getting following error:

ObjectDataSource 'odsJobs' could not find a non-generic method 'getStudioReleaseJobList' that has parameters: maximumRows, startRowIndex.

This is my .aspx code for objectDataSource"
<asp:ObjectDataSource ID="odsJobs" runat="server" 
                            EnablePaging="true" SelectMethod="getStudioReleaseJobList"  
                            TypeName="AliaForms.AliaDAO.clsChallanDAO">


Following is the code in my AliaDAO:
Public Shared Function getStudioReleaseJobList() As DataTable
            Dim cnt As Integer
            Dim objConn As SqlConnection = getConnection()
            Dim objCmd As SqlCommand
            Dim objDA As New SqlDataAdapter
            Dim objDT As New DataTable

            Try
                objCmd = New SqlCommand("sp_StudioReleaseChallan_sel", objConn)
                objCmd.CommandType = CommandType.StoredProcedure
                objDA.SelectCommand = objCmd
                objDA.Fill(objDT)
            Catch ex As Exception
            Finally
                objDA.Dispose()
                objCmd.Dispose()
                objConn.Close()
                objDA = Nothing
                objCmd = Nothing
                objConn = Nothing
            End Try
            Return objDT
        End Function


Can anyone tell me what is wrong with the code.

Thanks in advance
Posted

<asp:ObjectDataSource ID="odsCheck" runat="server" TypeName="MyClass.Check" SelectMethod="getAll">

       </asp:ObjectDataSource>


Create a class and write getAll method.
 
Share this answer
 
v2
Here is the simple solution
Actually I'm trying EnablePaging using ObjectDataSource and requires
maximumRows, startRowIndex

parameter to the required class (in my case its getStudioReleaseJobList)

Value for these parameter are by default passed by grid to which this ObjectDataSource is Bind

Hope this help the needy
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900