I work on Northwind database.server MS2008.In linq i active a sp then show me the 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' to 'System.Linq.IQueryable'. An explicit conversion exists (are you missing a cast?)
What to do solve this error.Why need custing.How to cust .Plz show some syntax