XML and ListBox

Discussion in 'Software' started by lexavision, Aug 11, 2006.

  1. lexavision

    lexavision

    Joined:
    Jul 27, 2006
    Messages:
    1
    Likes Received:
    0
    I need to load the following XML string into a dataset and diplay in a listbox using C#. I only need the information contained in the <ZIP> tag.


    XmlReader reader = new XmlTextReader(new StringReader(s));
    DataSet dsPickList = new DataSet();
    dsPickList.ReadXml(reader);


    <Data> <Table> <ZIP>27557</ZIP> <STATE>NC</STATE> <UNIQUE_ID>184</UNIQUE_ID> </Table> <Table> <ZIP>27559</ZIP> <STATE>NC</STATE> <UNIQUE_ID>187</UNIQUE_ID> </Table> <Table> <ZIP>27511</ZIP> <STATE>NC</STATE> <UNIQUE_ID>1082</UNIQUE_ID> </Table> <Table> <ZIP>27505</ZIP> <STATE>NC</STATE> <UNIQUE_ID>2007</UNIQUE_ID> </Table> <Table> <ZIP>27514</ZIP> <STATE>NC</STATE> <UNIQUE_ID>2857</UNIQUE_ID> </Table> <Table> <ZIP>27520</ZIP> <STATE>NC</STATE> <UNIQUE_ID>2861</UNIQUE_ID> </Table> <Table> <ZIP>27553</ZIP> <STATE>NC</STATE> <UNIQUE_ID>3805</UNIQUE_ID> </Table> <Table> <ZIP>27531</ZIP> <STATE>NC</STATE> <UNIQUE_ID>3810</UNIQUE_ID> </Table> <Table> <ZIP>27503</ZIP> <STATE>NC</STATE> <UNIQUE_ID>4686</UNIQUE_ID> </Table> <Table> <ZIP>27525</ZIP> <STATE>NC</STATE> <UNIQUE_ID>4708</UNIQUE_ID> </Table> <Table> <ZIP>27541</ZIP> <STATE>NC</STATE> <UNIQUE_ID>7443</UNIQUE_ID> </Table> <Table> <ZIP>27546</ZIP> <STATE>NC</STATE> <UNIQUE_ID>7461</UNIQUE_ID> </Table> <Table> <ZIP>27534</ZIP> <STATE>NC</STATE> <UNIQUE_ID>8336</UNIQUE_ID> </Table> <Table> <ZIP>27510</ZIP> <STATE>NC</STATE> <UNIQUE_ID>8342</UNIQUE_ID> </Table> <Table> <ZIP>27592</ZIP> <STATE>NC</STATE> <UNIQUE_ID>9307</UNIQUE_ID> </Table> <Table> <ZIP>27571</ZIP> <STATE>NC</STATE> <UNIQUE_ID>10219</UNIQUE_ID> </Table> <Table> <ZIP>27529</ZIP> <STATE>NC</STATE> <UNIQUE_ID>10228</UNIQUE_ID> </Table> <Table> <ZIP>27502</ZIP> <STATE>NC</STATE> <UNIQUE_ID>11137</UNIQUE_ID> </Table> <Table> <ZIP>27576</ZIP> <STATE>NC</STATE> <UNIQUE_ID>11140</UNIQUE_ID> </Table> <Table> <ZIP>27597</ZIP> <STATE>NC</STATE> <UNIQUE_ID>13906</UNIQUE_ID> </Table> <Table> <ZIP>27560</ZIP> <STATE>NC</STATE> <UNIQUE_ID>14883</UNIQUE_ID> </Table> <Table> <ZIP>27589</ZIP> <STATE>NC</STATE> <UNIQUE_ID>14889</UNIQUE_ID> </Table> <Table> <ZIP>27551</ZIP> <STATE>NC</STATE> <UNIQUE_ID>14891</UNIQUE_ID> </Table> <Table> <ZIP>27587</ZIP> <STATE>NC</STATE> <UNIQUE_ID>14892</UNIQUE_ID> </Table> <Table> <ZIP>27540</ZIP> <STATE>NC</STATE> <UNIQUE_ID>15826</UNIQUE_ID> </Table> <Table> <ZIP>27522</ZIP> <STATE>NC</STATE> <UNIQUE_ID>15830</UNIQUE_ID> </Table> <Table> <ZIP>27583</ZIP> <STATE>NC</STATE> <UNIQUE_ID>16765</UNIQUE_ID> </Table> <Table> <ZIP>27524</ZIP> <STATE>NC</STATE> <UNIQUE_ID>16781</UNIQUE_ID> </Table> <Table> <ZIP>27549</ZIP> <STATE>NC</STATE> <UNIQUE_ID>17647</UNIQUE_ID> </Table> <Table> <ZIP>27507</ZIP> <STATE>NC</STATE> <UNIQUE_ID>18676</UNIQUE_ID> </Table> <Table> <ZIP>27501</ZIP> <STATE>NC</STATE> <UNIQUE_ID>18684</UNIQUE_ID> </Table> <Table> <ZIP>27565</ZIP> <STATE>NC</STATE> <UNIQUE_ID>20558</UNIQUE_ID> </Table> <Table> <ZIP>27591</ZIP> <STATE>NC</STATE> <UNIQUE_ID>20560</UNIQUE_ID> </Table> <Table> <ZIP>27513</ZIP> <STATE>NC</STATE> <UNIQUE_ID>20564</UNIQUE_ID> </Table> <Table> <ZIP>27504</ZIP> <STATE>NC</STATE> <UNIQUE_ID>20571</UNIQUE_ID> </Table> <Table> <ZIP>27569</ZIP> <STATE>NC</STATE> <UNIQUE_ID>20572</UNIQUE_ID> </Table> <Table> <ZIP>27577</ZIP> <STATE>NC</STATE> <UNIQUE_ID>22448</UNIQUE_ID> </Table> <Table> <ZIP>27573</ZIP> <STATE>NC</STATE> <UNIQUE_ID>22449</UNIQUE_ID> </Table> <Table> <ZIP>27521</ZIP> <STATE>NC</STATE> <UNIQUE_ID>23368</UNIQUE_ID> </Table> <Table> <ZIP>27596</ZIP> <STATE>NC</STATE> <UNIQUE_ID>24336</UNIQUE_ID> </Table> <Table> <ZIP>27563</ZIP> <STATE>NC</STATE> <UNIQUE_ID>25264</UNIQUE_ID> </Table> <Table> <ZIP>27545</ZIP> <STATE>NC</STATE> <UNIQUE_ID>25275</UNIQUE_ID> </Table> <Table> <ZIP>27562</ZIP> <STATE>NC</STATE> <UNIQUE_ID>25283</UNIQUE_ID> </Table> <Table> <ZIP>27526</ZIP> <STATE>NC</STATE> <UNIQUE_ID>26219</UNIQUE_ID> </Table> <Table> <ZIP>27544</ZIP> <STATE>NC</STATE> <UNIQUE_ID>26221</UNIQUE_ID> </Table> <Table> <ZIP>27542</ZIP> <STATE>NC</STATE> <UNIQUE_ID>26226</UNIQUE_ID> </Table> <Table> <ZIP>27581</ZIP> <STATE>NC</STATE> <UNIQUE_ID>27154</UNIQUE_ID> </Table> <Table> <ZIP>27572</ZIP> <STATE>NC</STATE> <UNIQUE_ID>27161</UNIQUE_ID> </Table> <Table> <ZIP>27509</ZIP> <STATE>NC</STATE> <UNIQUE_ID>27167</UNIQUE_ID> </Table> <Table> <ZIP>27516</ZIP> <STATE>NC</STATE> <UNIQUE_ID>27170</UNIQUE_ID> </Table> <Table> <ZIP>27536</ZIP> <STATE>NC</STATE> <UNIQUE_ID>28198</UNIQUE_ID> </Table> <Table> <ZIP>27530</ZIP> <STATE>NC</STATE> <UNIQUE_ID>29111</UNIQUE_ID> </Table> </Data>
     
    lexavision, Aug 11, 2006
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.