how to select and retrieve data using linq query in entity framework

Total Post:341

 1304  View(s)
Rate this:
I want to  select and retrieve data using  linq query in entity framework how to do this please help me.
  1. Post:286

    Re: how to select and retrieve data in linq query in entity framework


    @model IList<ForumMVC.CUSTOMER>
        ViewBag.Title = "WebGrid CRUD Operations";  

    <table style="background-color: #ccc; width: 100%;">
        <thead style="background-color: red;">
        <tbody style="background-color: #ddd;">
            @foreach(var obj in Model)



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using ForumMVC;
    using System.Data.Entity;
    using ForumMVC.Models;
    namespace ForumMVC.Controllers
        public class HomeController : Controller
            forumEntities1 db = new forumEntities1();
            public ActionResult Index()
                IList<CUSTOMER> data = db.CUSTOMER.Where(p => p.CUST_ID < 70 && p.CUST_ID > 50).ToList();
                return View(data);



      Modified On Jan-22-2016 12:48:14 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.