Hi guys ,
This blog we
will explain how to write join query using linq to sql.
protected void Page_Load(object sender, EventArgs e)
{
selectjoinDataContext dt = new selectjoinDataContext();
//inner
join code
//--------------------
var selectme = from stu in dt.students
join cou in dt.Courses
on stu.SId equals cou.CId
select new
{
StudentID = stu.SId,
SName = stu.SName,
CName = cou.CName
};
GridView1.DataSource = selectme;
GridView1.DataBind();
No comments:
Post a Comment