I have ListView like this
<asp:ListView ID="ListView1" ItemType="test.Project"
SelectMethod="ListView1_GetData" runat="server">
I am trying to set the select method to a stored procedure using EF. the select method like this
public IQueryable<Test.Project> ListView1_GetData()
{
using (DREntities2 db=new DREntities2())
{
return db.GetLatestProjects().AsQueryable();
}
}
I get this error:
Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Linq.IQueryable'. An explicit conversion exists (are you missing a cast?)
If I remove the .AsQueryable(), I get this error:
Cannot implicitly convert type 'System.Data.Objects.ObjectResult' to 'System.Linq.IQueryable
Here is the definition of the GetLastestProjects_Result as returned by DREntities2 .GetLatestProjects():
public partial class GetLatestProjects_Result
{
public int ProjectID { get; set; }
public string Title { get; set; }
public string ShortDescr { get; set; }
public string Full_Descr { get; set; }
public int ProCatID { get; set; }
public bool Marquee { get; set; }
}
AsQueryable()?GetLatestProjectsmethod?