I want to get string xml attributes value in object. But i have multiple data node in string xml then i want to use for each loop for get value of node.But i am little confusing how and where can i use for each loop in following code.
ProcessVals =
Dim child = root.Element("Pass")
For Each rt As XElement In child
Dim passScroll As PassScroll = New PassScroll
Dim pass As New Pass
pass.LedgerName = child.Attribute("LedgerName").Value
pass.SerialFrom = Convert.ToInt32(child.Attribute("SerialFrom").Value)
pass.SerialTo = Convert.ToInt32(child.Attribute("SerialTo").Value)
pass.Qty = Convert.ToInt32(child.Attribute("Qty").Value)
pass.Rate = Convert.ToDouble(child.Attribute("Rate").Value)
pass.IssuedQty = Convert.ToInt32(child.Attribute("IssuedQty").Value)
passScroll.Pass = pass
Next
Any help will appreciate. Thank you in advance.
Replies
Know the answer? Post it — somebody with the same question will find it here.