Object reference not set to an instance of an object.
From: kgeorgop (kgeorgop.1kn8lr_at_mail.codecomments.com)
Date: 02/18/05
- Next message: Steve C. Orr [MVP, MCSD]: "Re: How to send Email"
- Previous message: Yoshitha: "Re: How to send Email"
- Next in thread: Ken Cox [Microsoft MVP]: "Re: Object reference not set to an instance of an object."
- Reply: Ken Cox [Microsoft MVP]: "Re: Object reference not set to an instance of an object."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Feb 2005 00:08:35 -0600
Can somebody assist. I build this code on a dev laptop and copied across
the entire code to a Windows 2003 server with 1.1 framework. It is basic
ASP.NET that uses web service for SQL Server 2000 DB access.
The code works fine on my dev laptop, just not on the non dev machine.
Here is the full error page:
Server Error in '/jobRequest' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
jobRequest.requestProof.Button1_Click(Object sender, EventArgs e)
+125
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
AND here is the requestProof snippet:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'insert code here for database insertion
Dim myJobRequest As New skillsDB.jobRequest
' a web method is called to check whether the name exists or
not
Dim checkName As New skillsDB.jobRequest
Dim userNameSet As DataSet =
checkName.findUser(Session("Name"))
' if exists then perform and update
If (userNameSet.Tables(0).Rows.Count <> 0) Then
Dim updateSkillsIndex As DataSet =
myJobRequest.userUpdate(Session("Name"), Session("BadgeID"),
Session("Division"), Session("Location"), Session("Data"),
Session("Voice"), Session("Converged"), Session("Security"),
Session("Hosting"), Session("ContactCentres"),
Session("Infrastructure"), _
Session("Applications"), Session("EMC"), Session("D2WProcess"),
Session("CostingSpreadsheets"), Session("SalesProcess"),
Session("TAS"), Session("ManageRelationships"),
Session("CustomerFocus"), _
Session("CommunicationSkills"), Session("DefineBuyingCriteria"),
Session("DecisionMaking"), Session("IssueResolution"),
Session("BidManagement"), Session("VendorManagement"), _
Session("Proposals"), Session("Negotiation"), Session("Presentation"),
Session("ContractWriting"), Session("BusinessCaseWriting"),
Session("FinancialDecisions"), Session("TransitionManagement"), _
Session("OperationalManagement"), Session("ProjectManagement"),
Session("TimeManagement"), Session("QualityFocus"), Session("MSWord"),
Session("MSProject"), Session("SMART"), Session("MSPowerpoint"), _
Session("MSExcel"), Session("NMS"), Session("OperatingSystems"),
Session("ApplicationIntegration"), Session("ApplicationDevelopment"),
Session("PortalDevelopment"), Session("DesktopManagement"), _
Session("EnterpriseDNA"), Session("DataCarriage"), Session("DataVPN"),
Session("Routers"), Session("Switches"),
Session("ConvergedTechnologies"), Session("VoiceCarriage"),
Session("PABX"), Session("KeySystems"), Session("IVR"), _
Session("Firewalls"), Session("IDS"), Session("HIDS"),
Session("ITSecurityVPN"), Session("Consultancy"))
Session("Result") = "The skills database has been updated
with the below details."
'if setSkiilsIndex is not NULL, then take me to my receipt
page
If Not IsDBNull(updateSkillsIndex) Then
Response.Redirect("requestComplete.aspx")
Else
'lblMessage.Text = "Database Save Error, please contact
Mark Ussher!!!"
End If
Else
Dim setSkillsIndex As DataSet =
myJobRequest.setSkills(Session("Name"), Session("BadgeID"),
Session("Division"), Session("Location"), Session("Data"),
Session("Voice"), Session("Converged"), Session("Security"),
Session("Hosting"), Session("ContactCentres"),
Session("Infrastructure"), _
Session("Applications"), Session("EMC"), Session("D2WProcess"),
Session("CostingSpreadsheets"), Session("SalesProcess"),
Session("TAS"), Session("ManageRelationships"),
Session("CustomerFocus"), _
Session("CommunicationSkills"), Session("DefineBuyingCriteria"),
Session("DecisionMaking"), Session("IssueResolution"),
Session("BidManagement"), Session("VendorManagement"), _
Session("Proposals"), Session("Negotiation"), Session("Presentation"),
Session("ContractWriting"), Session("BusinessCaseWriting"),
Session("FinancialDecisions"), Session("TransitionManagement"), _
Session("OperationalManagement"), Session("ProjectManagement"),
Session("TimeManagement"), Session("QualityFocus"), Session("MSWord"),
Session("MSProject"), Session("SMART"), Session("MSPowerpoint"), _
Session("MSExcel"), Session("NMS"), Session("OperatingSystems"),
Session("ApplicationIntegration"), Session("ApplicationDevelopment"),
Session("PortalDevelopment"), Session("DesktopManagement"), _
Session("EnterpriseDNA"), Session("DataCarriage"), Session("DataVPN"),
Session("Routers"), Session("Switches"),
Session("ConvergedTechnologies"), Session("VoiceCarriage"),
Session("PABX"), Session("KeySystems"), Session("IVR"), _
Session("Firewalls"), Session("IDS"), Session("HIDS"),
Session("ITSecurityVPN"), Session("Consultancy"))
Session("Result") = "Your skills have been created in the
skills database."
'if setSkiilsIndex is not NULL, then take me to my receipt
page
If Not IsDBNull(setSkillsIndex) Then
Response.Redirect("requestComplete.aspx")
Else
'lblMessage.Text = "Database Save Error, please contact
Mark Ussher!!!"
End If
End If
End Sub
-- kgeorgop ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------
- Next message: Steve C. Orr [MVP, MCSD]: "Re: How to send Email"
- Previous message: Yoshitha: "Re: How to send Email"
- Next in thread: Ken Cox [Microsoft MVP]: "Re: Object reference not set to an instance of an object."
- Reply: Ken Cox [Microsoft MVP]: "Re: Object reference not set to an instance of an object."
- Messages sorted by: [ date ] [ thread ]