kimmie8000
asked on
After binding my session variables at set to 0
Once the code is binds to the grid. I lose my session variables which makes updating an issue.
Can someone tell me how to keep my session variable for the update part of the LINQ query?
public void GridView1_RowEditing(objec t sender, GridViewEditEventArgs e)
{
LabelAcknMessage.Text = string.Empty;
GridView1.EditIndex = e.NewEditIndex;
// Get table and row for editing with index selected... This is when you click edit.
string strJobTitleName = (GridView1.Rows[e.NewEditI ndex].Find Control("l blJobTitle ") as Label).Text;
if (strJobTitleName != null)
{
HCGASF_MaintDataContext db = new HCGASF_MaintDataContext();
var JobTitle = (from jt in db.JobTitles
where jt.JobTitleName == strJobTitleName
select jt).SingleOrDefault();
Session["OLD_JobTitleID"] = JobTitle.JobTitleID;
// test string make sure it is in the right number.
string strTitle = Session["OLD_JobTitleID"]. ToString() ;
intTitle = Convert.ToInt32(strTitle);
}
string strHCApplicationName = (GridView1.Rows[e.NewEditI ndex].Find Control("l blHCApplic ation") as Label).Text;
if (strHCApplicationName != null)
{
HCGASF_MaintDataContext db = new HCGASF_MaintDataContext();
var HCApp = (from ap in db.HomeCareSoftwareLists
where ap.HCApplication == strHCApplicationName
select ap).SingleOrDefault();
Session["OLD_HCApplication ID"] = HCApp.HCSoftwareID;
// test string make sure it is in the right number.
string strHC = Session["OLD_HCApplication ID"].ToStr ing();
intHC = Convert.ToInt32(strHC);
}
BindData();
}
Can someone tell me how to keep my session variable for the update part of the LINQ query?
public void GridView1_RowEditing(objec
{
LabelAcknMessage.Text = string.Empty;
GridView1.EditIndex = e.NewEditIndex;
// Get table and row for editing with index selected... This is when you click edit.
string strJobTitleName = (GridView1.Rows[e.NewEditI
if (strJobTitleName != null)
{
HCGASF_MaintDataContext db = new HCGASF_MaintDataContext();
var JobTitle = (from jt in db.JobTitles
where jt.JobTitleName == strJobTitleName
select jt).SingleOrDefault();
Session["OLD_JobTitleID"] = JobTitle.JobTitleID;
// test string make sure it is in the right number.
string strTitle = Session["OLD_JobTitleID"].
intTitle = Convert.ToInt32(strTitle);
}
string strHCApplicationName = (GridView1.Rows[e.NewEditI
if (strHCApplicationName != null)
{
HCGASF_MaintDataContext db = new HCGASF_MaintDataContext();
var HCApp = (from ap in db.HomeCareSoftwareLists
where ap.HCApplication == strHCApplicationName
select ap).SingleOrDefault();
Session["OLD_HCApplication
// test string make sure it is in the right number.
string strHC = Session["OLD_HCApplication
intHC = Convert.ToInt32(strHC);
}
BindData();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or you a new problem ?