Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RowUpdating doesn't load new values

Status
Not open for further replies.

daveigh

Programmer
Oct 9, 2003
105
0
0
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_____________
 
How are you verifying that the updates are not taking. Are you looking in the data source or the GridView? You may need to rebind the gridview after the update to view the update in the gridview.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top