Object reference not set to an instance of an object

Hello,I had a grid view with edit item template with drop down lists and textboxes. When I am clicking "Update" button , I am getting an error "Object reference not set to an instance of an object" pointing at "UpdateRow " method. When I tried to debug I am getting null values in textboxes and dropdownlist .

Object reference error is thrown by compiler when there is NULL object you are trying to access it. Now as per your code, it looks textboxes and dropdownlist are null, first you need to use 'GridView1_RowUpdating' eventsee below sample, here I have access controls from gridviewRow and update them

If you are trying to access null object and perform action against that null object that time you will get this type of error, for example you are trying to assign some control value, but control is not able to find that means control id is null you are trying to use that control value that time you will get this type of error, in the same way many places we will get this type of issue, but the reason behind this is accessing null object. As you said textbox and dropdown values are null, may be because of that you will get this error, I suggest you to recheck why it is null? then you will get the solution for this.--------------------------------------------------------------------------------Give respect to your work, Instead of trying to impress your boss.

I am sure this issue is because some of the value coming as null values. It is trying to assing the null value into the typed value.

By using the debugger you can find the exception line. If you find the exact line you can easily identify the issue value

I am suspecting any one of the following value may be nullint id, string SupId, string SupName, string city, string state, string country, string status, string locationBy NathanDirection is important than speed