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 9117973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:01:35+00:00 2026-06-17T05:01:35+00:00

I am constructing a tree in wpf application based on the value returned from

  • 0

I am constructing a tree in wpf application based on the value returned from a method getvalues().
I am parsing an xml files and storing the values in the variable and returning it to a class which is accessing it’s value.I am accessing the xml file from the registry keys. If there is no xml file in my machine my application should show an emptry tree.

so i wrote like this. I returned null when there is no xml file

public class Model
 {
    public Model()
    {

            using (RegistryKey pRegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Something"))
            if (pRegKey != null)
            {

                Object val = pRegKey.GetValue("INSTALLLOGSDIR");
                basepath = (string)val1;
                tot_val = basepath+ @"\some.xml";
            }
            else
            {
                MessageBox.Show("some.xml Not found in ur machine.");
            }
    }

 public Mainclass[] getValues()
    {
        if (tot_val.Equals(null))
        {
            return null;
        }
        else
        {
        //return something of type Mainclass[];
        }
      }
}

But am keep getting an exception
No source available
Exception has been thrown by the target of an invocation.

I ll be glad if you help me to solve this problem. Sorry if it is a duplicate. I searched several forums. din find the related scenario.
Thanks in advance.

  • 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-17T05:01:37+00:00Added an answer on June 17, 2026 at 5:01 am

    As stated in comment:

    tot_val.Equals(null) is strange and if it supposed to compare if tot_value is null it will fail with NullPointerException – use == instead.

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

Sidebar

Related Questions

I am constructing a binary tree consisting of words from a sample paragraph, sorted
I have written the following code for constructing a tree from its inorder and
I am coding up an algorithm for constructing a suffix tree in Mathematica based
I'm constructing a generic binary tree which includes a struct, TreeNode. I implement a
We are constructing a mobile web application using PhoneGap and JQuery mobile. Here is
We are constructing an application that will be interacting with Exchange 2007 calendar functions.
I'm constructing an ecommerce application in Symfony, and I have a page which lists
I am having trouble constructing a jqGrid TreeGrid using local data. This method works
I am constructing an asp.net tree view by querying sharepoint user profiles. The accountname
When constructing an API response, which method is better for (manually) returning the status

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.