Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First point is that your XML isn't well formed - a quick copy and paste into an xml document in the your .NET project will show you that: <code>&lt;Response&gt; &lt;/claimInquiryResponse&gt;</code> for a start.</p> <p>If you can sort that out then: If you perform a ReadXml operation with ReadMode.Auto then you should be able to do the following. Note that extra columns are added by .NET to maintain the relations and I have hard coded these for now:</p> <pre><code>Dim strfile As String = "somefile.xml" Dim ds As New DataSet ds.ReadXml(strfile, XmlReadMode.Auto) For Each drInfo As DataRow In ds.Tables("info").Rows Debug.Print(drInfo.Item("lastname").ToString + " " + drInfo.Item("firstname").ToString) For Each drCodes As DataRow In ds.Tables("errorCodes").Rows If drCodes.Item("info_Id").ToString = drInfo.Item("info_Id").ToString Then For Each drCodeDetail As DataRow In ds.Tables("errorCode").Rows If drCodeDetail.Item("errorCodes_Id").ToString = drCodes.Item("errorCodes_Id").ToString Then Debug.Print(" Code -&gt;" + drCodeDetail.Item("errorCode_Text").ToString) End If Next End If Next Next </code></pre> <p>A better way to do this is probably to loop through the info table and then use a dataview to filter the errorCodes and the errorCode table to find the codes you are interested in:</p> <pre><code>Dim dvCodes As New DataView, dvCodeDetail As New DataView dvCodes = ds.Tables("errorCodes").DefaultView dvCodeDetail = ds.Tables("errorCode").DefaultView For Each drInfo As DataRow In ds.Tables("info").Rows Debug.Print(drInfo.Item("lastname").ToString + " " + drInfo.Item("firstname").ToString) dvCodes.RowFilter = "info_Id = " + drInfo.Item("info_Id").ToString For i As Integer = 0 To dvCodes.Count - 1 dvCodeDetail.RowFilter = "errorCodes_Id = " + dvCodes(i).Item(0).ToString For j As Integer = 0 To dvCodeDetail.Count - 1 Debug.Print(" Code -&gt;" + dvCodeDetail(j).Item(0).ToString) Next Next Next </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload