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

"system.nullreferenceexception" error

P: 2
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
Share this Question
Share on Google+
1 Reply


debasisdas
Expert 5K+
P: 8,127
Question moved to .NET Forum .
Nov 3 '07 #2

Post your reply

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