how to add xml data to listbox?

S

spowel4

VB 2005: Using an xml file as the data source, I need to fill a
listbox with data based upon what was selected in a combobox. In
other words, my data consists of a list of customers in a combobox;
once a particular customer is selected I need to populate a listbox
with data specific to the selected customer. A sample layout of the
xml file:
<RECORD>
<CUSTOMER_NUMBER>customer number</CUSTOMER_NUMBER>
<SHIPTO_ID>ship to id</SHIPTO_ID>
<SHIPTO_CITY>ship to state</SHIPTO_CITY>
<SHIPTO_STATE>ship to state</SHIPTO_STATE>
<SHIPTO_ZIPCODE>ship to zipcode</SHIPTO_ZIPCODE>
</RECORD>

I'm sure this would be easier if <CUSTOMER_NUMBER> were the parent
element rather than <RECORD> but the software that produces the xml
report isn't really modifiable as far as the structure of the xml
file.

So to recap: the form loads, populates the combobox with the customer
number data from each record, the user chooses a particular customer
number, then the program needs to populate a listbox with the ship-to
id data related to that particular customer. There can and will be
multiple records which have the same customer number but different
ship-to id's.

I've got the combobox populating with the customer numbers okay but
I'm stuck trying to figure out the next step.
 
G

Guest

So to recap: the form loads, populates the combobox with the customer
number data from each record, the user chooses a particular customer
number, then the program needs to populate a listbox with the ship-to
id data related to that particular customer. There can and will be
multiple records which have the same customer number but different
ship-to id's.

I've got the combobox populating with the customer numbers okay but
I'm stuck trying to figure out the next step.

I would deserialize the XML into a .NET object collection. Then bind the
form to the collection of records. From there, it's just standard .NET code
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top