to check datagridview cell for null value or empty I have used the following code
if (dgvPersonnelInfo.Rows[e.RowIndex].Cells[2].Value==null )
{
}
but it gives me error object reference not set to an instance of an object. Is there any one to help
Try checking to see if dgvPersonnelInfo.Rows[e.RowIndex].Cells[2] is null or not. If so then this will be the cause of your issue, as the code cannot find the value for an object that does not exist.