asp.net - In linq how to work on Storprocedure -


i work on northwind database.server ms2008.in linq active sp show me bellow error:

syntax :

<dxwgv:aspxgridview id="aspxgridview1" runat="server"              autogeneratecolumns="false" datasourceid="linqservermodedatasource1"              keyfieldname="categoryid">             <columns>                 <dxwgv:gridviewcommandcolumn visibleindex="0">                     <editbutton visible="true">                     </editbutton>                     <newbutton visible="true">                     </newbutton>                     <deletebutton visible="true">                     </deletebutton>                 </dxwgv:gridviewcommandcolumn>                 <dxwgv:gridviewdatatextcolumn caption="categoryid" fieldname="categoryid"                      visibleindex="1">                 </dxwgv:gridviewdatatextcolumn>                 <dxwgv:gridviewdatatextcolumn caption="categoryname" fieldname="categoryname"                      visibleindex="2">                 </dxwgv:gridviewdatatextcolumn>                 <dxwgv:gridviewdatatextcolumn caption="description" fieldname="description"                      visibleindex="3">                 </dxwgv:gridviewdatatextcolumn>             </columns>         </dxwgv:aspxgridview>   <dxdtlnq:linqservermodedatasource id="linqservermodedatasource1" runat="server"          onselecting="linqservermodedatasource1_selecting" /> 

c# syntax:

protected void linqservermodedatasource1_selecting(object sender, devexpress.data.linq.linqservermodedatasourceselecteventargs e)         {              northwinddatacontext db=new northwinddatacontext();              var r = db.select_all_product();                e.queryablesource = r; } 

error message:

error 1 cannot implicitly convert type 'system.data.linq.isingleresult' 'system.linq.iqueryable'. explicit conversion exists (are missing cast?)

what solve error.why need custing.how cust .plz show syntax

the reason fact procedure returns ienumerable<tentity> result.
need table-valued function work iqueryable<tentity>. take @ this article more information.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -