LINQ to SQL query to perform inner join on tables Product and ProductDocument on productID as primary key
protected void Page_Load(object sender, EventArgs e)
{
MydbDataContext db1 = new MydbDataContext();
//LINQ to SQL query to perform inner join on tables Product and ProductDocument on productID as primary key
var query = db1.Products.Join(db1.ProductDocuments, p => p.ProductID, m => m.ProductID, (c, m) => new {c.ProductID,m.DocumentID,c.Name });
GridView1.DataSource = query;
GridView1.DataBind();
}

No comments:
Post a Comment