Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
im create store producre
i want connect to web grid
how bind data from store producer
SQL
alter PROCEDURE [dbo].[GroupGallery]
   AS
BEGIN
 
     select ID_GGallery,FGroupGallery ,[dbo].[Groupgallary-get-countpic](ID_GGallery) as countpic,Fpic from groupgalleries
END


HTML
@model store producer
@{
    ViewBag.Title = "مدیریت تصاویر";
    <link href="@Url.Content("~/Content/webgrid.css")" rel="stylesheet" type="text/css" media="all" />
    Layout = "~/Areas/admin/Views/Shared/_AdminLayout.cshtml";
    var grid = new WebGrid(
     source: Model,
     defaultSort: "ID_GGallery",
     rowsPerPage: 50,
     canPage: true,
     canSort: true,
     selectionFieldName: "SelectedRow"
     );
    int rowVal = 0;
}
Posted

1 solution

You can not assign stored procedure as data source to some control - you must do it via the model...
See here some options you may have: http://www.c-sharpcorner.com/UploadFile/4b0136/stored-procedures-in-entity-framework-6-in-mvc-5/[^]
 
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