?
Solved

Load all XML file elements into a dropdownlist

Posted on 2007-11-29
3
Medium Priority
?
919 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
  • 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

862 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