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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:31:27+00:00 2026-05-24T05:31:27+00:00

I keep getting errors with this, and can’t see what I’m doing wrong. Here’s

  • 0

I keep getting errors with this, and can’t see what I’m doing wrong.

Here’s the code

private void _FixSave_Offline_Load(object sender, EventArgs e)
{
    System.Xml.XmlDocument NewGame = new System.Xml.XmlDocument();
    NewGame.Load(Application.StartupPath + "//Files//Checks_Offline.xml");

    foreach (System.Xml.XmlNode nameNode in NewGame.SelectNodes("//Games//NewGame"))
    {
        listView1.Items.Add(nameNode.Attributes["Name"].InnerText);
    }
}

And here is the XML Layout

<Games>
 <NewGame>
   <Name></Name>
   <Check></Check>
   <Static></Static>
   <Location></Location>
   <Start></Start>
   <Length></Length>
   <FoundBy></FoundBy>
   <Verified></Verified>
</NewGame>

Here’s is the error I keep getting

Error Message

and visual studio highlights the following code:

listView1.Items.Add(nameNode.Attributes["Name"].InnerText);

I’ve tried using not only “//” but also “/” so anything that will fix this will be more than welcome, b/c I can’t for the life of me see what I’m doing wrong.

  • 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-05-24T05:31:28+00:00Added an answer on May 24, 2026 at 5:31 am

    At a glance, you’re looking for an attribute with the name of “Name”, but there are no attributes on any of the XML elements in your example.

    I believe you want the content of the Name node:

    foreach (System.Xml.XmlNode nameNode in NewGame.SelectNodes("//Games//NewGame/Name"))
    {
        listView1.Items.Add(nameNode.Value);
    }
    

    You might have to play with the XPath expression a bit, depending on the actual structure of your XML document.

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

Sidebar

Related Questions

I keep getting Clang errors on the following type of code and I can't
Trying to install pear package and keep getting this strange error. Can you shed
After I installed Aptana (install directory: /usr/share/aptana ) I keep getting errors like this:
I keep getting this error System.Web.HttpException was unhandled by user code Message=Validation of viewstate
I keep getting this error when I try to call Find() public void findTxt(string
I keep getting this error whenever I call gethostbyname() in my C code. ==7983==
I got this URL: http://twitternieuws.com/class/function/ID?oauth_token=xxxxx&oauth_verifier=xxxxx And I keep getting errors like The page you
I'm trying to do a simple erase and keep getting errors. Here is the
I keep getting errors like this in my Product.wxs file. The primary key 'ExitDialog/Finish/EndDialog/Return/1'
Keep getting this error after inserting a subdatasheet into a query and trying to

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.