Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to group Northwind orders based on Customer ContactName

$
0
0

Im using northwind database . U may see the attached files .My view displays all orders from the database without an order . I want to display orders based on contactname (customer) and alphabetically . For example contact name AVARIA and under it to display all orders of this costumer and so on .

Because this is showing me all the orders coming from the database without any order .

public ActionResult Index()      {           var orders = db.Orders.Include(o => o.Customer).Include(o => o.Employee).Include(o => o.Shipper);            return View(orders.ToList());               }



I want to display like this :

<div>AVAIRA</div> <div>ORDER 1 OF AVAIRA FROM DATABASE WITH ITS DETAILS </div> <div>ORDER 2 OF AVAIRA FROM DATABASE WITH ITS DETAILS  </div> <div>ORDER 3 OF AVAIRA FROM DATABASE WITH ITS DETAILS  </div> <div> </div> <div>BECUA</div> <div>ORDER 1 OF BECUA FROM DATABASE WITH ITS DETAILS</div> <div>ORDER 1 OF BECUA FROM DATABASE WITH ITS DETAILS  </div> <div> </div> <div>AND SO ON </div>

 


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>