I\'m having trouble with the RowUpdating
Method. My GridView
is connected to our local SQL Server, and I\'m trying to update the data. Here is the cod
Not all GridViewRow have a DataItem.
You should add a if
block around your code and verify the row being updated is of type DataRow
.
if (e.Row.RowType == DataControlRowType.DataRow)
{
your code here...
}
More regarding RowTypes : http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.rowtype.aspx