Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9009015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:05:23+00:00 2026-06-16T02:05:23+00:00

I have been racking my brain (not hard to do) trying to figure this

  • 0

I have been racking my brain (not hard to do) trying to figure this exception out. I have a form that display’s user information. When I set breakpoints and step through the code. The method call returns the object (checked in the immediate window) but when I assign the user property to the label is when this occurs.

Here is my code:

public Form2()
        {
            UserInfo user = FileAccess.UserInfoFromXML();
            // All the members of user exist.
            label1.Text = "Screen Name: " + user.ScreenName; //This is throwing an Null Reference exception the UserInfo is not null
            label2.Text = "Full Name: "+ user.FirstName + " " + user.LastName;
            label3.Text = "Address: " + user.StreetAddress + " " + user.City + " " + user.State + " " + user.Zip;
            label4.Text = "Email Address: " + user.email;
            label5.Text = "Date Of Birth: " + user.DateOfBirth;
            label6.Text = "Start Date: " + user.StartDate;
            DateTime dt = DateTime.Parse( user.StartDate );
            dt.AddDays( 30 );
            label7.Text = "End Date: " + dt.ToShortDateString();

        }

Any ideas?
Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:05:24+00:00Added an answer on June 16, 2026 at 2:05 am

    You’ll have to let the InitializeComponent() call stay on top of the constructor.

    This designer-generated method initializes your components so the labels won’t be null anymore when you access them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been racking my brain trying to figure this out. Here is the scenario.
I have been racking my brains trying to figure this out for days and
I've been raking my brain trying to figure this one out. I have a
I've been racking my brain trying to figure out how to accomplish a link
So I've been racking my brain trying to figure out how to implement a
In trying to parse a date, I have been racking my brain for hours:
Stack Overflowers: I have been racking my brain trying to get an List(of T)
Okay I have been racking my brain trying to build a JSON array from
so i have been racking my brain with trying to get an audio/video broadcasting
I have been racking my brain for a few days trying to get a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.