473,387 Members | 1,512 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,387 software developers and data experts.

"system.nullreferenceexception" error

I'm getting the dreaded "nullreferenceexception" error with this code.

In an ASP application it works fine.
In VB Express 2005 it does not.

These are my imports ....

Imports System
Imports System.Net
Imports System.Net.IPAddress
Imports System.Net.Dns
Imports System.Net.Sockets
Imports Microsoft.VisualBasic
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Web
Imports System.Management
Imports System.Web.SessionState


Expand|Select|Wrap|Line Numbers
  1.         Dim ipaddr As String
  2.  
  3.         If System.Web.HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") Is DBNull.Value Then
  4.             MsgBox("Null")
  5.         Else
  6.             ipaddr = System.Web.HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")
  7.         End If
  8.  
Please HELP!
Aug 14 '07 #1
1 1532
debasisdas
8,127 Expert 4TB
Question moved to .NET Forum .
Nov 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Manny | last post by:
i'm using ver 1.1 of the framework developing a website, and seem to getting a random "System.NullReferenceException" error. The error occurs in different parts of the website in random fashion....
1
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I'm puzzled by an error message encountered while creating a Windows Service. In particular, I'm creating a second Windows Service within a Windows Service project, using Visual Studio 2005. The...
5
by: CoderMarc | last post by:
Hi, I can not get the system pause to work in a simple program. Here is my program below: // i/o example #include <iostream> using namespace std; int main ()
2
by: ganeshvkl | last post by:
i got error " An unhandled exception of type 'System.NullReferenceException' occurred in system.data.dll " when i run my VB.net 2003 with Sqlserver 2000 server program , the same program is working...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.