473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

runs in debug but not in production

I have a simple asp.net app which works fine in debug mode, but crashes on
the following line when I run it on the production server:

Dim dt As DataTable

I have tried the following variations which produce the same result:
Dim dt As System.Data.DataTable
Dim dt As DataTable = New DataTable

The error message reads: System.NullReferenceException: Object reference
not set to an instance of an object.

This is the only place in code that dt is declared. Funny that this will
work in debug and error out in production. Does anyone have any ideas? I
am out. :)

Scott

Nov 18 '05 #1
10 4860
I would think there is something else going on, like the production server
has some files out of date. So the line number that is shown when it
crashes isn't actually the code being executed.

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a simple asp.net app which works fine in debug mode, but crashes on
the following line when I run it on the production server:

Dim dt As DataTable

I have tried the following variations which produce the same result:
Dim dt As System.Data.DataTable
Dim dt As DataTable = New DataTable

The error message reads: System.NullReferenceException: Object reference
not set to an instance of an object.

This is the only place in code that dt is declared. Funny that this will
work in debug and error out in production. Does anyone have any ideas? I
am out. :)

Scott

Nov 18 '05 #2
Hi Scott,

Thanks you for using Microsoft Newsgroup Service. Based on your
description, one of your web page will running into "Null reference"
exception on production server, however runs ok on debug environment? Also,
you thought the problem is due to a "DataTable" variable. Is my
understanding of your problem correct?

If so, I think you may first try confirming the actual object which caused
the exception. Since you run to the exception on Production server, you may
add some code such as"

If dt is Nothing Then
.....

Or other to confirm whether the DataTable variable is the root caused of
the problem. In addition, I think Marina's suggestion is also considerable,
maybe you can reboot the web application or the web server? Or try creating
another page which does the has the same functions and operations in it and
run it on both debug and production server to see whether the problem
remain.
Please try out the preceding suggestions and let me know if you need any
help.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Alright I did the following:
1) Went to Microsoft's web site and did an update on anything it wanted to
update (the server is a Windows 2000 Pro OS)
2) Downloaded the latest .NET framework version (1.1 Redistributable
Package) and ran it on the server.
3) I opened the solution in VS and ran a build on it, saved the files and
then copied the whole directory from my inetpub/wwwroot directory to the
production directory on the server (after deleting all the files on the
server related to the project).

I even checked the references on the project to make sure I knew where they
were pointing to. I suspect this may be the problem. I have 2 references
in the project. I have them built as DLLs on my hard drive. I created a
reference to their DLLs from the main project and I see that VS dropped them
into the bin directory for the main project. The 2 sub-projects that allow
me to code the DLLs are also included in my solution for my application. Is
there somewhere else I should point them to?

Maybe it has nothing to do with that. Since my changes I am getting the
same error on the following line of code which follows the one I described
previously:

dt = ds.tables(0)

The error message (assuming it is showing me the right line of code) seems
to indicate it can't get a reference for an object, but the ds and dt
variables are declared properly.

Please!!!! Any thoughts on this would be appreciated! This isn't supposed
to happen in .NET!!!!

Scott

"Marina" <so*****@nospam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
I would think there is something else going on, like the production server
has some files out of date. So the line number that is shown when it
crashes isn't actually the code being executed.

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a simple asp.net app which works fine in debug mode, but crashes on the following line when I run it on the production server:

Dim dt As DataTable

I have tried the following variations which produce the same result:
Dim dt As System.Data.DataTable
Dim dt As DataTable = New DataTable

The error message reads: System.NullReferenceException: Object reference not set to an instance of an object.

This is the only place in code that dt is declared. Funny that this will work in debug and error out in production. Does anyone have any ideas? I am out. :)

Scott


Nov 18 '05 #4
1) Did you rebuild the 2 referenced projects after downloading the .NET 1.1
framework?

2) Are you sure the dataset is properly instantiated and that it contains at
least one datatable?

HTH

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:Oz**************@tk2msftngp13.phx.gbl...
Alright I did the following:
1) Went to Microsoft's web site and did an update on anything it wanted to update (the server is a Windows 2000 Pro OS)
2) Downloaded the latest .NET framework version (1.1 Redistributable
Package) and ran it on the server.
3) I opened the solution in VS and ran a build on it, saved the files and
then copied the whole directory from my inetpub/wwwroot directory to the
production directory on the server (after deleting all the files on the
server related to the project).

I even checked the references on the project to make sure I knew where they were pointing to. I suspect this may be the problem. I have 2 references
in the project. I have them built as DLLs on my hard drive. I created a
reference to their DLLs from the main project and I see that VS dropped them into the bin directory for the main project. The 2 sub-projects that allow me to code the DLLs are also included in my solution for my application. Is there somewhere else I should point them to?

Maybe it has nothing to do with that. Since my changes I am getting the
same error on the following line of code which follows the one I described
previously:

dt = ds.tables(0)

The error message (assuming it is showing me the right line of code) seems
to indicate it can't get a reference for an object, but the ds and dt
variables are declared properly.

Please!!!! Any thoughts on this would be appreciated! This isn't supposed to happen in .NET!!!!

Scott

"Marina" <so*****@nospam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
I would think there is something else going on, like the production server
has some files out of date. So the line number that is shown when it
crashes isn't actually the code being executed.

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a simple asp.net app which works fine in debug mode, but
crashes on the following line when I run it on the production server:

Dim dt As DataTable

I have tried the following variations which produce the same result:
Dim dt As System.Data.DataTable
Dim dt As DataTable = New DataTable

The error message reads: System.NullReferenceException: Object reference not set to an instance of an object.

This is the only place in code that dt is declared. Funny that this will work in debug and error out in production. Does anyone have any
ideas?
I am out. :)

Scott



Nov 18 '05 #5
1) Did you rebuild the 2 referenced projects after downloading the .NET 1.1
framework?

2) Are you sure the dataset is properly instantiated and that it contains at
least one datatable?

HTH

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:Oz**************@tk2msftngp13.phx.gbl...
Alright I did the following:
1) Went to Microsoft's web site and did an update on anything it wanted to update (the server is a Windows 2000 Pro OS)
2) Downloaded the latest .NET framework version (1.1 Redistributable
Package) and ran it on the server.
3) I opened the solution in VS and ran a build on it, saved the files and
then copied the whole directory from my inetpub/wwwroot directory to the
production directory on the server (after deleting all the files on the
server related to the project).

I even checked the references on the project to make sure I knew where they were pointing to. I suspect this may be the problem. I have 2 references
in the project. I have them built as DLLs on my hard drive. I created a
reference to their DLLs from the main project and I see that VS dropped them into the bin directory for the main project. The 2 sub-projects that allow me to code the DLLs are also included in my solution for my application. Is there somewhere else I should point them to?

Maybe it has nothing to do with that. Since my changes I am getting the
same error on the following line of code which follows the one I described
previously:

dt = ds.tables(0)

The error message (assuming it is showing me the right line of code) seems
to indicate it can't get a reference for an object, but the ds and dt
variables are declared properly.

Please!!!! Any thoughts on this would be appreciated! This isn't supposed to happen in .NET!!!!

Scott

"Marina" <so*****@nospam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
I would think there is something else going on, like the production server
has some files out of date. So the line number that is shown when it
crashes isn't actually the code being executed.

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a simple asp.net app which works fine in debug mode, but
crashes on the following line when I run it on the production server:

Dim dt As DataTable

I have tried the following variations which produce the same result:
Dim dt As System.Data.DataTable
Dim dt As DataTable = New DataTable

The error message reads: System.NullReferenceException: Object reference not set to an instance of an object.

This is the only place in code that dt is declared. Funny that this will work in debug and error out in production. Does anyone have any
ideas?
I am out. :)

Scott



Nov 18 '05 #6
I went and clicked on "Build" on the pop-up menus for each sub project and
then the main project. Earlier, I was clicking on Debug/build in VS which I
assumed did the whole solution. Is there something else I need to do?

I will list my code here that instantiates the relevant variables, but I
should point out that this code works fine in debug mode in VS and also if I
run it on the development server when I access the site with:
http://localhost/project. If I use the server name or IP address (ie.
http://server1/project) It errors out. In fact, the only way I can get the
error message itself and not the generic version of the error, is to go to
the server and try to run the code with the server name or IP address. I
hope that gives you good clues.

The line of code it stops on is part of the following set:

================================================== ===============
Public Class DecPat1
...
Public ds As DataSet
...
Public Sub HandleCommands(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
...
ds = CType(Session("MyData"), DataSet)
Dim dt As System.Data.DataTable
dt = ds.Tables(0)
...
End Sub
...
End Class
================================================== ===============

I have tried variations of the "Dim dt As ..." line. As far as whether or
not I am using the correct table inside of the Tables collection, I only
know that it works in debug mode, so I think that tells me I am referencing
it properly.

I hope this helps. Please let me know what additional information you could
use or what you think.

Scott

PS. I ran the framework redistributable on my workstation and on the server
just now... just to be on the safe side and try to rule that out. :)
"John Miner" <mi****@celeris.ca> wrote in message
news:uS**************@TK2MSFTNGP12.phx.gbl...
1) Did you rebuild the 2 referenced projects after downloading the .NET 1.1 framework?

2) Are you sure the dataset is properly instantiated and that it contains at least one datatable?

HTH

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:Oz**************@tk2msftngp13.phx.gbl...
Alright I did the following:
1) Went to Microsoft's web site and did an update on anything it wanted

to
update (the server is a Windows 2000 Pro OS)
2) Downloaded the latest .NET framework version (1.1 Redistributable
Package) and ran it on the server.
3) I opened the solution in VS and ran a build on it, saved the files and
then copied the whole directory from my inetpub/wwwroot directory to the
production directory on the server (after deleting all the files on the
server related to the project).

I even checked the references on the project to make sure I knew where

they
were pointing to. I suspect this may be the problem. I have 2 references in the project. I have them built as DLLs on my hard drive. I created a reference to their DLLs from the main project and I see that VS dropped

them
into the bin directory for the main project. The 2 sub-projects that

allow
me to code the DLLs are also included in my solution for my application.

Is
there somewhere else I should point them to?

Maybe it has nothing to do with that. Since my changes I am getting the
same error on the following line of code which follows the one I described previously:

dt = ds.tables(0)

The error message (assuming it is showing me the right line of code) seems to indicate it can't get a reference for an object, but the ds and dt
variables are declared properly.

Please!!!! Any thoughts on this would be appreciated! This isn't

supposed
to happen in .NET!!!!

Scott

"Marina" <so*****@nospam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
I would think there is something else going on, like the production

server has some files out of date. So the line number that is shown when it
crashes isn't actually the code being executed.

"Scott" <sc***********@nospam.ma-hc.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
> I have a simple asp.net app which works fine in debug mode, but

crashes
on
> the following line when I run it on the production server:
>
> Dim dt As DataTable
>
> I have tried the following variations which produce the same result:
> Dim dt As System.Data.DataTable
> Dim dt As DataTable = New DataTable
>
> The error message reads: System.NullReferenceException: Object

reference
> not set to an instance of an object.
>
> This is the only place in code that dt is declared. Funny that this

will
> work in debug and error out in production. Does anyone have any

ideas?
I
> am out. :)
>
> Scott
>
>
>



Nov 18 '05 #7
Scott wrote:
I went and clicked on "Build" on the pop-up menus for each sub project and
then the main project. Earlier, I was clicking on Debug/build in VS which I
assumed did the whole solution. Is there something else I need to do?

I will list my code here that instantiates the relevant variables, but I
should point out that this code works fine in debug mode in VS and also if I
run it on the development server when I access the site with:
http://localhost/project. If I use the server name or IP address (ie.
http://server1/project) It errors out. In fact, the only way I can get the
error message itself and not the generic version of the error, is to go to
the server and try to run the code with the server name or IP address. I
hope that gives you good clues.

The line of code it stops on is part of the following set:

================================================== ===============
Public Class DecPat1
...
Public ds As DataSet
...
Public Sub HandleCommands(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
...
ds = CType(Session("MyData"), DataSet)
Dim dt As System.Data.DataTable
dt = ds.Tables(0)
...
End Sub
...
End Class
================================================== ===============

I have tried variations of the "Dim dt As ..." line. As far as whether or
not I am using the correct table inside of the Tables collection, I only
know that it works in debug mode, so I think that tells me I am referencing
it properly.

I hope this helps. Please let me know what additional information you could
use or what you think.

Scott

PS. I ran the framework redistributable on my workstation and on the server
just now... just to be on the safe side and try to rule that out. :)


Your problem will have nothing to do with the declarations of the
variables - you need to check at runtime to see that your DataSet or
DataTable references are non-null.

Your code snippet shows that you're getting the dataset from the Session
collection, but it doesn't show how the dataset is created in the first
place.

In any case, add the following lines of code right after you get the
dataset reference from the Sessoin collection - it should help you get
closer to the cause of the problem:

If ds Is Nothing Then
Trace.Warn("DataSet is Null")
Return
End If

If ds.Tables Is Nothing Then
Trace.Warn("ds.Tables is Null")
Return
End If

And add a trace="true" attribute to the aspx page's @Page directive.

Now when you navigate to that page, you'll get trace output added to the
bottom, and there will be a line written in red indicating which
reference is null.

You'll have to debug some other part of your application to find out why.
--
mikeb
Nov 18 '05 #8
Just a thought, but have you confirmed that RIGHTS are set correctly to
the queries used to populate the session variable you use as your
datasource?

For example, in SQL Server 2000 (or whatever you use) you may need to
set permissions on these queries depending on your setup. Sometimes the
username/passwords are different from dev server to production server.

I'll admit to once spending quite a bit of debug time only to have that
be the cause (blush)...now it's the first thing I check if I know my
query returns the dataset in SQL Analyzer, etc.,but I get Nothing for
the dataset.

Good luck.

Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #9
Scott wrote:
Mike,
I added the code you mentioned and was able to make it run on my
workstation... I added an "Else... trace.warn("DataSet is NOT null")" to
each of the sections so I could confirm that it got to that line of code. I
also added a "Return" right after the test code so it doesn't try to run the
rest of the procedure. On my workstation this all runs fine whether I run
in debug mode or access the code through IE with
//localhost/directory/pagename and I get the red lines in the stack trace on
the aspx page with the "NOT null" messages.

I copy the code to the server and get different results. If I try to run it
in IE with "//<servername>/<directory>/ I get "Object Reference Not set to
an instance of an object". If I use "//localhost/<directory>/ it runs fine
but I don't see the trace messages in red... I get the trace info, just not
our messages.
I think that means that the updated .aspx file is being copied to the
server, but the updated code-behind dll is not. The .aspx file has the
@Page directive which enables the trace (which you're seeing). But, the
code-behind DLL has the calls to Trace.Warn(). Sine the Trace.Warn()
messages are not being seen, it seems that the dll is not being copied over.

Of course, I'm assuming that you're using a code-behind model.

I can't think of why you'd get different behavior using //<servername>
and //localhost, unless there is DNS, WINS or host file issues.

Does a simple "hello word" .aspx page work in that virtual directory?

I started wondering if the problem is with the way that I am releaseing the
application to the server or the server itself. I have another machine here
available to me with Windows 2000 Server loaded and normally used as a
SQL2000 server but has IIS on it, so I loaded dotnetfx.exe on it, did not
reboot, dropped the files from my workstation's inetpub/wwwroot/project1
directory into inetpub/wwwroot/project1 on the server and tried to run the
program throuh IE on that server with
//localhost/testzone/project1/decpat.aspx. I got an error screen saying
"Server Error in '/' Application". It is referencing the "authentication
mode="windows"" line in web.config and suggesting I should create a virtual
directory. So, I set one up with Read, Run, Execute and Write permissions
and everything works great (although I don't see the red statements in the
trace).

So, I go back to the first server and remove the virtual directory I was
using and add it back again, this time making sure to check the Read, Run,
Execute and Write boxes. When I try to run the code I get an error saying
that "Object Not Set to and Instance Of An Object". So, I have the same
code on both servers, but one server will not run it. Question is: Why?
Could it be that I did not release it to the first server properly? Is
there a better way to release a project? Any other reasons for this that
you can think of would also be appreciated.

Thank you for your time in helping me to understand this issue.

Scott

BTW: I don't think permissions are an issue because I am running 2 other
applications on the first server that do similar tasks with the same SQL
server database and not having any problems.


"mikeb" <ma************@mailnull.com> wrote in message
news:#k**************@TK2MSFTNGP11.phx.gbl...
Scott wrote:
I went and clicked on "Build" on the pop-up menus for each sub project
and
then the main project. Earlier, I was clicking on Debug/build in VS
which I
assumed did the whole solution. Is there something else I need to do?

I will list my code here that instantiates the relevant variables, but I
should point out that this code works fine in debug mode in VS and also
if I
run it on the development server when I access the site with:
http://localhost/project. If I use the server name or IP address (ie.
http://server1/project) It errors out. In fact, the only way I can get
the
error message itself and not the generic version of the error, is to go
to
the server and try to run the code with the server name or IP address.
I
hope that gives you good clues.

The line of code it stops on is part of the following set:

=============================================== ==================
Public Class DecPat1
...
Public ds As DataSet
...
Public Sub HandleCommands(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
...
ds = CType(Session("MyData"), DataSet)
Dim dt As System.Data.DataTable
dt = ds.Tables(0)
...
End Sub
...
End Class
=============================================== ==================

I have tried variations of the "Dim dt As ..." line. As far as whether
or
not I am using the correct table inside of the Tables collection, I only
know that it works in debug mode, so I think that tells me I am
referencing
it properly.

I hope this helps. Please let me know what additional information you
could
use or what you think.

Scott

PS. I ran the framework redistributable on my workstation and on the
server
just now... just to be on the safe side and try to rule that out. :)


Your problem will have nothing to do with the declarations of the
variables - you need to check at runtime to see that your DataSet or
DataTable references are non-null.

Your code snippet shows that you're getting the dataset from the Session
collection, but it doesn't show how the dataset is created in the first
place.

In any case, add the following lines of code right after you get the
dataset reference from the Sessoin collection - it should help you get
closer to the cause of the problem:

If ds Is Nothing Then
Trace.Warn("DataSet is Null")
Return
End If

If ds.Tables Is Nothing Then
Trace.Warn("ds.Tables is Null")
Return
End If

And add a trace="true" attribute to the aspx page's @Page directive.

Now when you navigate to that page, you'll get trace output added to the
bottom, and there will be a line written in red indicating which
reference is null.

You'll have to debug some other part of your application to find out why.
--
mikeb


--
mikeb
Nov 18 '05 #10
Mike,
Thanks for your reply. Seeing as how this is working on the second server I
need to move forward with it from there (I have a deadline to meet and this
has put me behind). So, I may not get to play with this for a while but
wanted to respond to your comments.

Yes, I am using a code-behind model and I agree with you that it appears the
aspx is looking for DLLs that it can't find. I even opened the aspx and the
aspx.vb files in notepad and looked for mis-directed links to the wrong
locations, but couldn't find anything wrong. This is certainly perplexing
and it is unfortunate that I need to move forward and leave this issue
behind.

I will schedule our techs to wipe-out the OS on the first server and
reinstall W2000 Server w/.NET or W2003. Maybe there is something 'twisted'
in the OS that is causing a problem... this IS our development server so it
ends up being a playground for new ideas... something on the server may be
causeing this.

Thanks again for your help. :)

Scott

"mikeb" <ma************@mailnull.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
Scott wrote:
Mike,
I added the code you mentioned and was able to make it run on my
workstation... I added an "Else... trace.warn("DataSet is NOT null")" to
each of the sections so I could confirm that it got to that line of code. I also added a "Return" right after the test code so it doesn't try to run the rest of the procedure. On my workstation this all runs fine whether I run in debug mode or access the code through IE with
//localhost/directory/pagename and I get the red lines in the stack trace on the aspx page with the "NOT null" messages.

I copy the code to the server and get different results. If I try to run it in IE with "//<servername>/<directory>/ I get "Object Reference Not set to an instance of an object". If I use "//localhost/<directory>/ it runs fine but I don't see the trace messages in red... I get the trace info, just not our messages.
I think that means that the updated .aspx file is being copied to the
server, but the updated code-behind dll is not. The .aspx file has the
@Page directive which enables the trace (which you're seeing). But, the
code-behind DLL has the calls to Trace.Warn(). Sine the Trace.Warn()
messages are not being seen, it seems that the dll is not being copied

over.
Of course, I'm assuming that you're using a code-behind model.

I can't think of why you'd get different behavior using //<servername>
and //localhost, unless there is DNS, WINS or host file issues.

Does a simple "hello word" .aspx page work in that virtual directory?

I started wondering if the problem is with the way that I am releaseing the application to the server or the server itself. I have another machine here available to me with Windows 2000 Server loaded and normally used as a
SQL2000 server but has IIS on it, so I loaded dotnetfx.exe on it, did not reboot, dropped the files from my workstation's inetpub/wwwroot/project1
directory into inetpub/wwwroot/project1 on the server and tried to run the program throuh IE on that server with
//localhost/testzone/project1/decpat.aspx. I got an error screen saying
"Server Error in '/' Application". It is referencing the "authentication mode="windows"" line in web.config and suggesting I should create a virtual directory. So, I set one up with Read, Run, Execute and Write permissions and everything works great (although I don't see the red statements in the trace).

So, I go back to the first server and remove the virtual directory I was
using and add it back again, this time making sure to check the Read, Run, Execute and Write boxes. When I try to run the code I get an error saying that "Object Not Set to and Instance Of An Object". So, I have the same
code on both servers, but one server will not run it. Question is: Why? Could it be that I did not release it to the first server properly? Is
there a better way to release a project? Any other reasons for this that you can think of would also be appreciated.

Thank you for your time in helping me to understand this issue.

Scott

BTW: I don't think permissions are an issue because I am running 2 other applications on the first server that do similar tasks with the same SQL
server database and not having any problems.


"mikeb" <ma************@mailnull.com> wrote in message
news:#k**************@TK2MSFTNGP11.phx.gbl...
Scott wrote:

I went and clicked on "Build" on the pop-up menus for each sub project


and
then the main project. Earlier, I was clicking on Debug/build in VS


which I
assumed did the whole solution. Is there something else I need to do?

I will list my code here that instantiates the relevant variables, but Ishould point out that this code works fine in debug mode in VS and also


if I
run it on the development server when I access the site with:
http://localhost/project. If I use the server name or IP address (ie.
http://server1/project) It errors out. In fact, the only way I can get


the
error message itself and not the generic version of the error, is to go


to
the server and try to run the code with the server name or IP address.


I
hope that gives you good clues.

The line of code it stops on is part of the following set:

=============================================== ==================
Public Class DecPat1
...
Public ds As DataSet
...
Public Sub HandleCommands(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
...
ds = CType(Session("MyData"), DataSet)
Dim dt As System.Data.DataTable
dt = ds.Tables(0)
...
End Sub
...
End Class
=============================================== ==================

I have tried variations of the "Dim dt As ..." line. As far as whether


or
not I am using the correct table inside of the Tables collection, I onlyknow that it works in debug mode, so I think that tells me I am


referencing
it properly.

I hope this helps. Please let me know what additional information you


could
use or what you think.

Scott

PS. I ran the framework redistributable on my workstation and on the


server
just now... just to be on the safe side and try to rule that out. :)

Your problem will have nothing to do with the declarations of the
variables - you need to check at runtime to see that your DataSet or
DataTable references are non-null.

Your code snippet shows that you're getting the dataset from the Session
collection, but it doesn't show how the dataset is created in the first
place.

In any case, add the following lines of code right after you get the
dataset reference from the Sessoin collection - it should help you get
closer to the cause of the problem:

If ds Is Nothing Then
Trace.Warn("DataSet is Null")
Return
End If

If ds.Tables Is Nothing Then
Trace.Warn("ds.Tables is Null")
Return
End If

And add a trace="true" attribute to the aspx page's @Page directive.

Now when you navigate to that page, you'll get trace output added to the
bottom, and there will be a line written in red indicating which
reference is null.

You'll have to debug some other part of your application to find out why.

--
mikeb


--
mikeb

Nov 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Slinn | last post by:
I was wondering what the best way to acheive the following would be: What I would like is for the background of every page in my ASP.NET web project to contain a soft red GIF containing the word...
12
by: nospam | last post by:
All the documentation says that leaving an ASP.NET application in debug mode has a big performance hit. I can't detect any difference between debug and non-debug modes. Am I missing something or is...
6
by: Luis Esteban Valencia | last post by:
Hi, I want in debug mode debug=true. In release (production), no reason debug to be true but the questions are: 1. Does it slow the application (holding debug=true) 2. If yes, how can I solve...
1
by: Steve Franks | last post by:
Is there a way I can have my options set up so that on the production machine debug=false is always used, but on my dev machine debug=true is used? Currently I do not know how to do this,...
1
by: shekhartgs | last post by:
Please tell me how to debug an ASP.NET web application residing on a remote server? Can you pls tell me point by point as I am a new bie to a lil extent. Also please alert me where errors...
6
by: tascien | last post by:
Hi guys, here is a puzzling question... I am able to debug my project on my dev server very fine. Now, here is a question: - I set the project to release. I copy the project to the production...
3
by: Bob Johnson | last post by:
It is my understanding - and please correct me if I'm wrong - that when building a project in debug mode, I can deploy the .pdb file along with the ..exe and thereby have access to the specific...
3
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi I've been reading about various ways in which people can have multiple web.config "sections" for different scenarios (configSource proerty, etc). In my situation, I just have a dev and...
3
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.