mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

XML format not filling data table correct

Feb 22 2012 12:36 PM
Reading xml format is not a strong point of mine, and although i am reading and display an xml file my code seems to stop and jump to the first line of the xml?

the format i'm trying to read is as below:

<?xml version="1.0" encoding="ISO-8859-1" ?>
- <result id="xxxxx" generated="xxxx" mode="live" account_id="000">
  <vrm>AXXXXX</vrm> 
  <make>FORD</make>
  <model>FIESTA FREESTYLE</model>
- <valuation db="201202" mileage="110000">
- <match id="92">
  <make>FORD</make>
  <model>FIESTA (1999-02)</model>
  <variation>5DR HATCHBACK 1.25 FREESTYLE</variation>

I'm using the following code to read and display into a datagrid using http WebRequest.

DataSet

dsLookup.ReadXml(response.GetResponseStream());


dsLookup = new DataSet()


dataGridView1.DataSource = dsLookup.Tables[0];

The problem is, it reads down to this line then stops:

- <valuation db="201202" mileage="110000">

even if i try to go past and display into a text field like below it still doesn't read past that problem line? is there a way to bypass the line above?

value_retailTextBox.Text = dsLookup.Tables[0].Rows[0][5].ToString();




Answers (8)