Solved

Reading a xml File in a vb.net dropdown list

Posted on 2004-09-30
3
215 Views
Last Modified: 2010-04-17
Hi
I am developing a web application in which I have a XML file whose values I need to read in a vb.net dropdown list . How would I do this ?

I can create my  xml file in of the type. I do have the flexibility of creating the xml file of anyformat easy for programming. The ID is stored as the value of the dropdownlist and the name is the display of dropdown list.
<Groups>
<name id=123>Groupname1</name>
<name id=12>Groupname1</name>
</Groups>
0
Comment
Question by:ChanderMadhavi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
itcnbwise earned 250 total points
ID: 12191364
It's been a while since I worked with this, but here's some old code I had which will go through an XML file and print the id and value.  Yiou just have to add the drop-down box code.

Sub Page_Load(S As Object, E As EventArgs)

      If Not IsPostBack Then
                        DIM xpthdoc1 as XPathDocument
                        DIM xpthnv1 as XPathNavigator

              xpthdoc1=new XpathDocument(server.mappath("groups.xml"))
              xpthnv1=xpthdoc1.CreateNavigator()
              
              xpthnv1.MoveToRoot()
              xpthnv1.MoveToFirstChild()
       
            while (xpthnv1.MoveToFirstChild())
                  Response.Write(xpthnv1.name & ": " & xpthnv1.Value & "<br>")

                            while (xpthnv1.MoveToNext())
                        Response.Write("2" &xpthnv1.name & ": " & xpthnv1.Value & "<br>")
                  end while

            end while

      End If

End Sub
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question