Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir

Object reference not set to an instance of an object in dataschema()
when i generate excel report.
Posted
Updated 9-Oct-11 21:07pm
v2
Comments
André Kraak 8-Oct-11 9:18am    
That is a lot of code to go through. Can you narrow it down for us, in which line are you getting the error?
E.F. Nijboer 8-Oct-11 9:20am    
You need to be more specific where the error is raised. Also, you can set a breakpoint at the beginning and use the debugger to step through it line by line. You can check out the variables and you'll quickly notice what's going wrong (or not as expected).

1 solution

Without knowing where the error occurs it is difficult to be sure, but I would be very suspicious of any code like this:
VB
Dim columnName As String = System.Convert.ToString(drow("ColumnName"))

Are you sure you called your column "ColumnName"? It does seem a bit unlikely...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900