?
Solved

Load all XML file elements into a dropdownlist

Posted on 2007-11-29
3
Medium Priority
?
917 Views
Last Modified: 2013-11-26
Hi,

I have a XML file that I want to load all the child elements into a Dropdownlist. Can I do that and how?

If there are more than one of the same child elements I only want to only show one.

Thanks
0
Comment
Question by:ALawrence007
[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
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
vbturbo earned 2000 total points
ID: 20376562
Hi this will read a xml file and only populate the atribute CustName into your combo

      Dim testing As New DataSet

        testing.ReadXml("C:\SomeFolder\SomeXMLfile.xml")
       MyCombo.DataSource = testing.Tables(0)
       MyCombo.DisplayMember = "CustName" 'The value to be shown in the list.
       MyCombo.ValueMember = "CustName" 'The value that will return the SelectedValue property of the currently
       selected item.  

vbturbo
0
 

Author Comment

by:ALawrence007
ID: 20382264
vbTurbo,

Thanks for that reply. I worked on this last night and keep on getting the following error:
Cannot add a SimpleContent column to a table containing element columns or nested relations

Any I deas?
0
 
LVL 18

Assisted Solution

by:vbturbo
vbturbo earned 2000 total points
ID: 20417907
Do you have any table relations in your dataset ?

testing.Relations.Clear()

else try paste some code

vbturbo
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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