create table Product( Pro_id int primary key, Pro_Name varchar(50) ) create table Order( Order_id int primary key, Pro_id int foreign key references Product(Pro_id), DateOfOrder Date, Quantity int check(Quantity > 0) )
var p = (from o in db.Order join prod in db.Product on o.pro_id equals prod.pro_id orderby prod.pro_name select new { prod.pro_name, o.dateoforder, o.quantity, o.order_id });
//An alternative in fluent syntax var pro_names = db.Order.Join(db.Product,o=>o.pro_id,p=>p.pro_id,(o,p)=>new {p.pro_name}). OrderBy(a=>a.pro_name);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)