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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:27:23+00:00 2026-05-29T11:27:23+00:00

I don’t use .Net unless I have to, and for this project I have

  • 0

I don’t use .Net unless I have to, and for this project I have to. I like the PHP way of doing things but, it seems I am stuck with using a Collection of Object‘s to store/retrieve the data I need. I have my Collection loaded with my Objects‘s and the code to iterate through the collection, my problem is I am unable to retrieve the “key” as it would be called in PHP (I believe in this case it is actually the name of the object). Consider the following example:

            Dim xDoc As XPathDocument = New XPathDocument(fName)
            Dim xNav As XPathNavigator = xDoc.CreateNavigator()

            Dim sender As XPathNodeIterator
            sender = xNav.Select("/data/sender/val")
            While (sender.MoveNext())
                SenderInfo.Add(sender.Current.GetAttribute("n", ""), sender.Current.Value)
            End While

            For Each item As Object In SenderInfo
                Dim value As String = item.ToString()
                //need to store the key here
                Dim key As String = Nothing
            Next

As you can see, I am navigating an XML document, and creating an Object with some Key/Value pairs. The Object would look something like this if it were in JSON:

{"name":"John Smith","address1":"123 Anywhere St.","city":"This City","state":"FL"}

When I iterate though the Collection I can only get the value of the object, but I need the Key, in this instance I want “name”,”address1″,”city”,”state” to be stored in a variable for each iteration.

Any ideas? Or am I going about this the wrong way?

Thanks in advance for the help, I am truly stuck on this one!

  • 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-29T11:27:24+00:00Added an answer on May 29, 2026 at 11:27 am

    SenderInfo should be a Dictionary<String,String>. Here‘s the documentation and example code, at the bottom, including VB.NET.

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

Sidebar

Related Questions

I don't know if this has been asked before, but what i'd like to
I don't like Jackson. I want to use ajax but with Google Gson. So
Don't ask me why but i can't use this method because I need to
don't know better title for this, but here's my code. I have class user
Don't know why but I can't find a solution to this. I have 3
Don't know how to google for such, but is there a way to query
I don't know whether this is really possible, but I'm trying my best. If
I don't think this is particularly quirky, but in an attempt to control my
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't be afraid to use any technical jargon or low-level explanations for things, please.

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.