Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Reply
How to use for each loop for xml
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
kalu singh rao
9y
723
1
Reply
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 = <PassScroll>
<Pass LedgerName="SB FORMS" SerialFrom="1" SerialTo="100" Qty="10" Rate="10.000000" IssuedQty="10" />
<Pass LedgerName="CD FORMS" SerialFrom="1" SerialTo="2500" Qty="50" Rate="15.000000" IssuedQty="10" />
</PassScroll>
Dim root As XElement = XElement.Parse(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.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Convert DataGridView Column to propercase
Convert DataGridView Column into Proper Case