Note that there are some explanatory texts on larger screens.

plurals
  1. POXML to dataset - problem finding what datarow contains a datatable
    primarykey
    data
    text
    <p>Sorry if the description is poor, but I don't know how else to put this... But here is an example of the XML structure </p> <pre><code>&lt;?xml version=”1.0” encoding=”UTF-8”&gt; &lt;Response xmlns="http://www.blah.com"&gt; &lt;searchResult&gt; &lt;info&gt; &lt;firstName&gt;John&lt;/firstName&gt; &lt;lastName&gt;Doe&lt;/lastName&gt; &lt;totalCharges&gt;100.00&lt;/totalCharges&gt; &lt;nonPaymentCode&gt;99999&lt;/nonPaymentCode&gt; &lt;/info&gt; &lt;info&gt; &lt;firstName&gt;Susan&lt;/firstName&gt; &lt;lastName&gt;Doe&lt;/lastName&gt; &lt;totalCharges&gt;1000.00&lt;/totalCharges&gt; &lt;errorCodes&gt; &lt;errorCode&gt;12345&lt;/errorCode&gt; &lt;/errorCodes&gt; &lt;/info&gt; &lt;info&gt; &lt;firstName&gt;Peter&lt;/firstName&gt; &lt;lastName&gt;Doe&lt;/lastName&gt; &lt;totalCharges&gt;10.00&lt;/totalCharges&gt; &lt;errorCodes&gt; &lt;errorCode&gt;12345&lt;/errorCode&gt; &lt;errorCode&gt;54321&lt;/errorCode&gt; &lt;errorCode&gt;85246&lt;/errorCode&gt; &lt;/errorCodes&gt; &lt;/info&gt; &lt;/searchResult&gt; &lt;/claimInquiryResponse&gt; </code></pre> <p>I have transformed this into a dataset in order to access the information as a datatable. But my problem is trying to get the errorCodes. I was trying to figure this out by checking the relationship of the tables. Because I have to figure out what error codes are associated with what person, in order to display them properly. I cannot control the XML structure, and everything is optional in order to reduce excess bandwidth so changing it is not an option at this point. But here is an example of what I have done:</p> <pre><code>For Each rel As DataRelation In ds.Tables(i).ChildRelations If rel.Nested Then Dim temp As New DataTable temp = rel.ChildTable For Each relationship As DataRelation In temp.ChildRelations For Each row As DataRow In relationship.ChildTable.Rows For Each column As DataColumn In relationship.ChildTable.Columns rowValues &amp;= column.ColumnName &amp; "-" &amp; row(column.ColumnName) &amp; "-" &amp; relationship.RelationName &amp; vbCrLf Next Next Next End If Next </code></pre> <p>This gives me the actual values of the data inside of errorCodes table. but I can't figure out how to link it back to what row/person it was associated with. The indexes the relationship generate are built off of their occurance (for instance the error codes for susan will be 0 and for peter it will be 1), not relating to their location in the XML. </p> <p>I am either doing this wrong or looking at this data incorrectly. I know I can use a XML reader to get all this, but the data is already in the dataset, and I feel like learning something new. so only suggest it as a last resort please. </p> <p>thanks in advance! </p>
    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.
 

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