Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I made a display of data from a database table. Later I made a data mining by name or year, and everything works. But now I would like to search for data that are displayed in the JTable. I try to use stored procerdure that will retrieve data from the database.
I get Error 6 No overload for method 'Procedura_searchdata' takes 0 arguments

Thanks for answer

Procedure

SQL
Alter PROCEDURE searchdata
    
    @name varchar(200) = null,
    
    @year datatime = null
    
    AS
    
    BEGIN
    
          SET NOCOUNT ON;
    
          SET @name =  NULLIF(@name, '')
    
          SET @year = NULLIF(@year , '')
    
        SELECT Name FROM Person
        WHERE
    
        (@name = '' or Name = @name)
    
        AND
    
        (@year = '' or Year = @year)
    
    END
GO


JSON


C#
     public JsonResult Check()
            {
    
                    using (var z = new database())
                        {
                            DataList = z.ShowDataLista().ToList<ProcedureShowDataLista_Result>();
    SearchData = ctx.Procedure_searchdata().ToList<Procedure_searchdata_Result>();
        
                    } 
    
                    return Json(new { Result = "OK", Records = DataList,SearchData});
    
            

       
        }



.cshtml

HTML
 <div>
        @using (Html.BeginForm("Index", "Project", FormMethod.Get))
        {
            Search
            @Html.RadioButton("findBy", "Name", true) <text>Name </text>
           @Html.RadioButton("findBy", "Year") <text>Year </text>
           <br />


         @Html.TextBox("search")

                   <input type="submit" value="Search" />

            }
        </div>
     <script>
     $('#Check').jtable({
            messages: polishMessages,
            paging: true,
            actions: {
                listAction: '@Url.Action("Check")'

            },
            fields: {
                Name: {
                    title: 'Name',
                    width: '40px'
                },
                Year: {
                    title: 'Year',
                    width: '40px'
                }

            }
        });

        $('#Check').jtable('load');

    });

</script>
Posted

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