Using a Simple Join in LINQ:
RekabuDataContext RKdb = new RekabuDataContext();
protected void Page_Load(object sender, EventArgs e)
{
BindGridView();
}
public void BindGridView()
{
var q = from records in RKdb.Tests
from recordsnew in RKdb.Images
where records.id == recordsnew.id
select recordsnew;
gvRekabu.DataSource = q;
gvRekabu.DataBind();
}
Assigning Custom Columns header in LINQ:
public void Bind()
{
var q = from fields in RKdb.Tests
where (fields.salary >= 20000)
select new
{
CandidateName = fields.Name,
CandidateLocation = fields.Loaction,
CandidateSalary = fields.salary,
}
;
gvRekabu.DataSource = q;
gvRekabu.DataBind();
}
Thanks,
Nitin Sharma