locked
read KeywordPerformanceReportRequest xml into dataset RRS feed

  • Question

  •  

    Can you just do a DataSet.LoadXml(reportStr) on the xml you receive back and then just read the rows of the datatable?  When i do that it creates a dataset with 20 datatables.  The xml coming back from v4 of the api, could be directly loaded into a dataset.  Basically i am looking for ideas on the best way to read the xml coming back from the web service?
    Wednesday, June 18, 2008 8:38 PM

All replies

  • Hi

    I had the same problem and worked around it using the VB code below;

     

    Read the XML into a dataset (repDS)... the object aggTable ends up with all the rows from each of the separate tables.

    Not sure if there's a better way to do this?

     

    pete

     

    Dim aggTable As DataTable = Nothing

    If repDS.Tables.Contains("row") Then

    Dim dt As DataTable = repDS.Tables("row")

    aggTable = dt.Copy

    For Each rel As DataRelation In dt.ChildRelations

    aggTable.Columns.Add(rel.ChildTable.TableName)

    For Each row As DataRow In rel.ChildTable.Rows

    Dim fr As DataRow = aggTable.Rows.Find(row("row_id"))

    fr(rel.ChildTable.TableName) = row("Value")

    Next

    Next

    End If

     

    Tuesday, June 24, 2008 9:54 AM
  • Yeah i actually just moved to getting the reports in csv, its a lot smaller, and faster.  But yeah i just found it strange that the xml for v4 vs v5 would be changed.  Thanks.

    Tuesday, June 24, 2008 3:48 PM