Link to home
Create AccountLog in
Avatar of SA85
SA85

asked on

"does not exist in the current context"

Please help me fixing this code:
server.cs:
    public class OrderDataRepository : BaseRepository<OrderData>
    {
        public IQueryable<OrderData> GetAllOrderData()
        {
            return GetQuery();
        }

Open in new window


client.aspx.cs:
   public partial class Control : System.Web.UI.Page
    {             
        protected void Page_Load(object sender, EventArgs e)
    {
        OrderViewRepository rep = new OrderViewRepository();

        var results = GetAllOrderData().
                      GroupBy(o => o.DRIVER_ID).
                      Select(g =>
                                new
                                {
                                    DriverId = g.Key,
                                    OrderCount = g.Count(),
                                    OrderCountWhereNameIsNotNull = 
                                                      g.Count(o => o.RECEIVE_NAME != null)
                                }).ToList();

        DataViewer.DataSource = results;
        DataViewer.DataBind();
    }
    }

Open in new window


client.aspx:
<form id="Form1" runat="server">
        <asp:GridView runat="server" ID="DataViewer">
        </asp:GridView>
    </form>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of SA85
SA85

ASKER