I have a VB.NET Windows form that I've been developing for about a month. The app consists of several forms. Aside from all of the usual Windows Forms controls manipulation (i.e. the GUI), it executes some simple SQL statements against a SQL Server 2000 database that is on the network, and runs a couple of Crystal Reports on that data. When I say "simple SQL statements," I mean in the order of "select * from
" which returns 8000 or so small records.
I was testing it over and over and over again before distributing it - and I got this error:[tt]
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.[/tt]
I'm no expert developer, but I've been around the block around enough times to know what should cause a NullReferenceException and what should not. I could run the identical Crystal Reports report 50 times (literally) over and over before I get this exception. Sometimes it happens after just a few times, and sometimes it takes dozens of times. But the important point here is that I am doing exactly the same three steps over and over:
starting at my main menu,
clicking my "Run Report" button, and
once the report comes up, clicking my "Go Back to Main Menu" button
and repeating that process.
When the error occurs, it occurs on the red line, below:[tt]
Dim view As New View
Me.Hide()
view.Show() [/tt]
which is the line that displays a new form called "view".
Allegedly, there is something null on that form. There are four objects on that form:
a button,
a label,
a panel, and
a CrystalReportsViewer
If one had to guess the null culprit, one would certainly suspect the CrystalReportsViewer.
Once, I got a different error (although I can't tell if it was on the same line as I was running in Release mode):[tt]
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: External component has thrown an exception.[/tt]
I haven't a clue what that means altogether...
Back to the more common exception... Why would replicating the same scenario repeatedly - on completely static data sometimes be null and 98% of the time work?
Thank you very much - this one has me totally baffled!
Lazer
I was testing it over and over and over again before distributing it - and I got this error:[tt]
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.[/tt]
I'm no expert developer, but I've been around the block around enough times to know what should cause a NullReferenceException and what should not. I could run the identical Crystal Reports report 50 times (literally) over and over before I get this exception. Sometimes it happens after just a few times, and sometimes it takes dozens of times. But the important point here is that I am doing exactly the same three steps over and over:
starting at my main menu,
clicking my "Run Report" button, and
once the report comes up, clicking my "Go Back to Main Menu" button
and repeating that process.
When the error occurs, it occurs on the red line, below:[tt]
Dim view As New View
Me.Hide()
view.Show() [/tt]
which is the line that displays a new form called "view".
Allegedly, there is something null on that form. There are four objects on that form:
a button,
a label,
a panel, and
a CrystalReportsViewer
If one had to guess the null culprit, one would certainly suspect the CrystalReportsViewer.
Once, I got a different error (although I can't tell if it was on the same line as I was running in Release mode):[tt]
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: External component has thrown an exception.[/tt]
I haven't a clue what that means altogether...
Back to the more common exception... Why would replicating the same scenario repeatedly - on completely static data sometimes be null and 98% of the time work?
Thank you very much - this one has me totally baffled!
Lazer