By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

visual studio debugger message

P: n/a
anybody know what causes this error message reported by visual studio just in tiime debugger ?

I get it when trying to populate a simple gridview from a datareader. Running locally, the code compiles, but after the page
renders, I get the debugger popping up and it gives me the following error message
"an unhandled exception('System.NullReferenceException') occurred in aspnet_wp_exe "

Oct 22 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
It means that the compiler found a null value where an object instance was required.
Find the part of your code which is expecting a reference value it isn't getting.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
anybody know what causes this error message reported by visual studio just in tiime debugger ?
I get it when trying to populate a simple gridview from a datareader. Running locally, the code
compiles, but after the page renders, I get the debugger popping up and it gives me the following
error message
"an unhandled exception('System.NullReferenceException') occurred in aspnet_wp_exe "

Oct 22 '06 #2

P: n/a
Check the trace log for the web app to see if more detailed info is there.
Without knowing your code exactly, here's a possible scenario. You have a
function or block of code that fetches the datareader. For some reason the
database code bombs out and leaves a datareader that's not fully
initialized, hence is null. When you set the datareader as the datasource
and attempt to bind to it, it's a null value, not an empty datareader, but a
null value instead since the datareader wasn't initialized fully.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
anybody know what causes this error message reported by visual studio just
in tiime debugger ?

I get it when trying to populate a simple gridview from a datareader.
Running locally, the code compiles, but after the page renders, I get the
debugger popping up and it gives me the following error message
"an unhandled exception('System.NullReferenceException') occurred in
aspnet_wp_exe "



Oct 22 '06 #3

P: n/a
but the page renders as expected....
The page trace shows no errors on the page.

The error message appears well after all is completed.

== code =====
Dim users as New DBClass
DisplayGrid.DataSource=users.Return_Reader("SELECT name, email FROM users_profile")
DisplayGrid.DataBind()

Public Class DBClass
Function Return_Reader(ByVal strSQL As String)
....
DBReader = Query.ExecuteReader(system.data.CommandBehavior.Cl oseConnection)
Return DBReader
end functon
end class
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message news:Or**************@TK2MSFTNGP03.phx.gbl...
Check the trace log for the web app to see if more detailed info is there. Without knowing your code exactly, here's a possible
scenario. You have a function or block of code that fetches the datareader. For some reason the database code bombs out and leaves
a datareader that's not fully initialized, hence is null. When you set the datareader as the datasource and attempt to bind to it,
it's a null value, not an empty datareader, but a null value instead since the datareader wasn't initialized fully.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:Oi**************@TK2MSFTNGP03.phx.gbl...
>anybody know what causes this error message reported by visual studio just in tiime debugger ?

I get it when trying to populate a simple gridview from a datareader. Running locally, the code compiles, but after the page
renders, I get the debugger popping up and it gives me the following error message
"an unhandled exception('System.NullReferenceException') occurred in aspnet_wp_exe "




Oct 22 '06 #4

P: n/a
Why don't you try to test the DBReader to see if it's null before setting
the datasource to it. That may give you an idea of whether or not it is
actually returning any results. That's one of the key things to keep in mind
when depending upon any variable, you have to test to ensure it isn't null
before it's manipulated or consumed in some fashion. If you're testing to
see if it's null first, then you could trap the null and handle it
gracefully without receiving the error.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:Ol**************@TK2MSFTNGP05.phx.gbl...
but the page renders as expected....
The page trace shows no errors on the page.

The error message appears well after all is completed.

== code =====
Dim users as New DBClass
DisplayGrid.DataSource=users.Return_Reader("SELECT name, email FROM
users_profile")
DisplayGrid.DataBind()

Public Class DBClass
Function Return_Reader(ByVal strSQL As String)
...
DBReader =
Query.ExecuteReader(system.data.CommandBehavior.Cl oseConnection)
Return DBReader
end functon
end class
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:Or**************@TK2MSFTNGP03.phx.gbl...
>Check the trace log for the web app to see if more detailed info is
there. Without knowing your code exactly, here's a possible scenario. You
have a function or block of code that fetches the datareader. For some
reason the database code bombs out and leaves a datareader that's not
fully initialized, hence is null. When you set the datareader as the
datasource and attempt to bind to it, it's a null value, not an empty
datareader, but a null value instead since the datareader wasn't
initialized fully.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
>>anybody know what causes this error message reported by visual studio
just in tiime debugger ?

I get it when trying to populate a simple gridview from a datareader.
Running locally, the code compiles, but after the page renders, I get
the debugger popping up and it gives me the following error message
"an unhandled exception('System.NullReferenceException') occurred in
aspnet_wp_exe "





Oct 22 '06 #5

P: n/a
getting more errors ---

now showing "aspnet_wp.exe (PID#) stopped unexpectedly."

Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1000
Date: 10/22/2006
Time: 2:58:57 PM
User: N/A
Computer: *************
Description:
aspnet_wp.exe (PID#) stopped unexpectedly.


"Mark Fitzpatrick" <ma******@fitzme.comwrote in message news:eZ**************@TK2MSFTNGP03.phx.gbl...
Why don't you try to test the DBReader to see if it's null before setting the datasource to it. That may give you an idea of
whether or not it is actually returning any results. That's one of the key things to keep in mind when depending upon any
variable, you have to test to ensure it isn't null before it's manipulated or consumed in some fashion. If you're testing to see
if it's null first, then you could trap the null and handle it gracefully without receiving the error.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:Ol**************@TK2MSFTNGP05.phx.gbl...
>but the page renders as expected....
The page trace shows no errors on the page.

The error message appears well after all is completed.

== code =====
Dim users as New DBClass
DisplayGrid.DataSource=users.Return_Reader("SELEC T name, email FROM users_profile")
DisplayGrid.DataBind()

Public Class DBClass
Function Return_Reader(ByVal strSQL As String)
...
DBReader = Query.ExecuteReader(system.data.CommandBehavior.Cl oseConnection)
Return DBReader
end functon
end class
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message news:Or**************@TK2MSFTNGP03.phx.gbl...
>>Check the trace log for the web app to see if more detailed info is there. Without knowing your code exactly, here's a possible
scenario. You have a function or block of code that fetches the datareader. For some reason the database code bombs out and
leaves a datareader that's not fully initialized, hence is null. When you set the datareader as the datasource and attempt to
bind to it, it's a null value, not an empty datareader, but a null value instead since the datareader wasn't initialized fully.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:Oi**************@TK2MSFTNGP03.phx.gbl...
anybody know what causes this error message reported by visual studio just in tiime debugger ?

I get it when trying to populate a simple gridview from a datareader. Running locally, the code compiles, but after the page
renders, I get the debugger popping up and it gives me the following error message
"an unhandled exception('System.NullReferenceException') occurred in aspnet_wp_exe "





Oct 22 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.