I have a GridView which needs to get updated on RowUpdating Event. How can I update data using LINQ?
I am populating GV using LINQ too and here is the code for that:
protected void Page_Load(object sender, EventArgs e)
{
string getEntity = Request.QueryString["EntityID"];
int getIntEntity = Int16.Parse(getEntity);
using (OISLinq2SqlVs1DataContext dt = new OISLinq2SqlVs1DataContext())
{
var tr = from r in dt.Users
join s in dt.Entities on r.Entity_ID equals s.ID
where s.ID == getIntEntity
select new
{
s.Name,
r.FirstName,
r.LastName,
s.Email,
//r.Email,
r.UserID,
r.Pwd,
s.Company,
s.Description,
s.Phone,
s.Fax,
s.WebSite
};
gvShowRegistration.DataSource = tr;
gvShowRegistration.DataBind();
}
}