Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DEBUG help, System.NullReferenceException

DEBUG help, System.NullReferenceException

Scheduled Pinned Locked Moved ASP.NET
helpdebugging
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ibuprofen
    wrote on last edited by
    #1

    First off all, yes I have googled it, and its such a vauge error code, that lots of pages that come up, arent helping much, Here is the error Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 70: } Line 71: string strWho = ""; Line 72: strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+"."; Line 73: Label2.Text = strWho; Line 74: Label2.Font.Bold = true; Source File: c:\dimhrs\helpdesk\userfeedback.aspx.cs Line: 72 and here is my page load. private void Page_Load(object sender, System.EventArgs e) { //strAdd=""; if(!IsPostBack) { Panel1.Visible=false; LoadGrid(); } string strWho = ""; strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+"."; Label2.Text = strWho; Label2.Font.Bold = true; user=(CUsers)Session["SessionUser"]; QCDate.Text= DateTime.Now.ToShortDateString()+" "+DateTime.Now.ToShortTimeString(); strAdd="; ["+user.UserID+" - Date: "+ QCDate.Text + "]: "; Review.Text=QCDate.Text.Insert(Review.Text.Length,strAdd); if(user.NeedActionHelp==true) { NeedAction.Enabled=true; } else { NeedAction.Enabled=false; if(Comments.Text!="" && NeedAction.Checked==false) { SJReview.Visible=true; } else if(Comments.Text=="" && NeedAction.Checked==false) { SJReview.Visible=false; } else { } } }

    T 1 Reply Last reply
    0
    • I Ibuprofen

      First off all, yes I have googled it, and its such a vauge error code, that lots of pages that come up, arent helping much, Here is the error Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 70: } Line 71: string strWho = ""; Line 72: strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+"."; Line 73: Label2.Text = strWho; Line 74: Label2.Font.Bold = true; Source File: c:\dimhrs\helpdesk\userfeedback.aspx.cs Line: 72 and here is my page load. private void Page_Load(object sender, System.EventArgs e) { //strAdd=""; if(!IsPostBack) { Panel1.Visible=false; LoadGrid(); } string strWho = ""; strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+"."; Label2.Text = strWho; Label2.Font.Bold = true; user=(CUsers)Session["SessionUser"]; QCDate.Text= DateTime.Now.ToShortDateString()+" "+DateTime.Now.ToShortTimeString(); strAdd="; ["+user.UserID+" - Date: "+ QCDate.Text + "]: "; Review.Text=QCDate.Text.Insert(Review.Text.Length,strAdd); if(user.NeedActionHelp==true) { NeedAction.Enabled=true; } else { NeedAction.Enabled=false; if(Comments.Text!="" && NeedAction.Checked==false) { SJReview.Visible=true; } else if(Comments.Text=="" && NeedAction.Checked==false) { SJReview.Visible=false; } else { } } }

      T Offline
      T Offline
      Tarakeshwar Reddy
      wrote on last edited by
      #2

      Ibuprofen wrote:

      strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+".";

      Looks like the error is to do with the object user. Get the value of the userid and role into a string, debug and check if its got to do with the object user.

      string strUserID = user.UserID;
      string strRole = user.Role;
      strWho="Welcome "+strUserID+" you are logged in as "+strRole+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+".";

      I 1 Reply Last reply
      0
      • T Tarakeshwar Reddy

        Ibuprofen wrote:

        strWho="Welcome "+user.UserID+" you are logged in as "+user.Role+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+".";

        Looks like the error is to do with the object user. Get the value of the userid and role into a string, debug and check if its got to do with the object user.

        string strUserID = user.UserID;
        string strRole = user.Role;
        strWho="Welcome "+strUserID+" you are logged in as "+strRole+" the date and time is now"+DateTime.Now.ToShortTimeString()+", "+DateTime.Now.ToShortDateString()+".";

        I Offline
        I Offline
        Ibuprofen
        wrote on last edited by
        #3

        Thanks! Just posting what came up next, I pretty sure I can fix this, just figure the more questions posted here, the better answer archieve we get. Here's the Error Cannot find column [System.Web.UI.WebControls.TextBox]. 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.Data.EvaluateException: Cannot find column [System.Web.UI.WebControls.TextBox]. Source Error: Line 138: DataTable dt=ds.Tables[0]; Line 139: string filterExp="autoNum="+autoNum; Line 140: DataRow[] rowFound= dt.Select(filterExp); Line 141: foreach (DataRow dr in rowFound) Line 142: { Source File: c:\dimhrs\helpdesk\userfeedback.aspx.cs Line: 140 and the majority of the load record private void LoadRecord(string recNumber) { LoadGrid(); Panel2.Visible=false; Panel1.Visible=true; DataTable dt=ds.Tables[0]; string filterExp="autoNum="+autoNum; DataRow[] rowFound= dt.Select(filterExp); foreach (DataRow dr in rowFound) { DateSubmit.Text=dr["DateSubmit"].ToString(); TicketNum.Text=dr["autoNum"].ToString(); SubmitBy.Text=dr["Name"].ToString();

        I 1 Reply Last reply
        0
        • I Ibuprofen

          Thanks! Just posting what came up next, I pretty sure I can fix this, just figure the more questions posted here, the better answer archieve we get. Here's the Error Cannot find column [System.Web.UI.WebControls.TextBox]. 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.Data.EvaluateException: Cannot find column [System.Web.UI.WebControls.TextBox]. Source Error: Line 138: DataTable dt=ds.Tables[0]; Line 139: string filterExp="autoNum="+autoNum; Line 140: DataRow[] rowFound= dt.Select(filterExp); Line 141: foreach (DataRow dr in rowFound) Line 142: { Source File: c:\dimhrs\helpdesk\userfeedback.aspx.cs Line: 140 and the majority of the load record private void LoadRecord(string recNumber) { LoadGrid(); Panel2.Visible=false; Panel1.Visible=true; DataTable dt=ds.Tables[0]; string filterExp="autoNum="+autoNum; DataRow[] rowFound= dt.Select(filterExp); foreach (DataRow dr in rowFound) { DateSubmit.Text=dr["DateSubmit"].ToString(); TicketNum.Text=dr["autoNum"].ToString(); SubmitBy.Text=dr["Name"].ToString();

          I Offline
          I Offline
          Ibuprofen
          wrote on last edited by
          #4

          Just had to create the string for my autoNum field.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups