I used gridview in my system to review users, anyway when I need to delete user, I need to deleted all rows in many tables depends on UserId. Actually I created a stored procedure take an input parameter (UserId) from gridview.
When I execute app. and delete user an error messge is:
Object reference not set to an instance of an object.
That's mean a null in send parameter to stored procedure
A first chance exception of type 'System.NullReferenceException' occurred in WebApplication1.dll , can not able to catch (UserId) Valye
I change method
string idvalue = gvbremployee.DataKeys[row.RowIndex].Values["UserId"].ToString();
to
object idvalue = gvbremployee.Rows[e.RowIndex].Cells[0].UniqueID;
So what a problem, please.
Many thanks