Lets start by saying that I am debugging someone else's code :-) The error occurs at the code routine that is attempting to export data from a gridview to an excel file.
GridView gv = new GridView();
Table table = new Table();
int maxRow = 60000;
int gvrow = Data().Tables[0].Rows.Count;
The error is occuring at Data().Tables[0].Rows.Count
The error in the immediate window is:
? Data().Tables[0].Rows.Count
A first chance exception of type 'System.FormatException' occurred in System.Data.dll
'Data()' is null
The error message is:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Any ideas what is wrong here?
Data() returns null. Fix that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With