daveigh
Programmer
- Oct 9, 2003
- 105
Hi guys, I just started coding in c# so please bear with me. I've been trying to use gridview via RowUpdating to update current the current row using this code. Also, I have a DAL file that handles the updating via stored procedure:
daBattery daBattery = new daBattery();
oBattery oBattery = new oBattery();
int rowIndex = e.RowIndex;
GridViewRow row = gvBattery.Rows[rowIndex];
oBattery.Tag_ID = Convert.ToInt32(row.FindControl("Tag_ID"));
oBattery.Site_Name = Convert.ToString(row.FindControl("lSite_Name"));
oBattery.Ticket_Num = Convert.ToInt32(row.FindControl("Ticket_Num"));
oBattery.Analyst_Name = Convert.ToString(row.FindControl("Analyst_Name"));
oBattery.Review_Date = Convert.ToDateTime(row.FindControl("Review_Date"));
oBattery.Num_of_Errors = Convert.ToInt32(row.FindControl("Num_of_Errors"));
daBattery.Update(oBattery);
The problem is, it doesn't load the new values whenever I enter new values & click on Update link. What could I have missed? Thanks in advance!
______________CRYOcoustic_____________
daBattery daBattery = new daBattery();
oBattery oBattery = new oBattery();
int rowIndex = e.RowIndex;
GridViewRow row = gvBattery.Rows[rowIndex];
oBattery.Tag_ID = Convert.ToInt32(row.FindControl("Tag_ID"));
oBattery.Site_Name = Convert.ToString(row.FindControl("lSite_Name"));
oBattery.Ticket_Num = Convert.ToInt32(row.FindControl("Ticket_Num"));
oBattery.Analyst_Name = Convert.ToString(row.FindControl("Analyst_Name"));
oBattery.Review_Date = Convert.ToDateTime(row.FindControl("Review_Date"));
oBattery.Num_of_Errors = Convert.ToInt32(row.FindControl("Num_of_Errors"));
daBattery.Update(oBattery);
The problem is, it doesn't load the new values whenever I enter new values & click on Update link. What could I have missed? Thanks in advance!
______________CRYOcoustic_____________