VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Get Specific Element Value From XML String Posted by chrissyboy on 5 Jan 2011 at 11:24 AM
First post for me so hi to all :)I'm consuming some web service stuff in SSIS and have got stuck with an issue that I thought would take minutes to resolve... I was wrong.

I'm an SSIS / SQL developer so only get mixed up in vb.net when SSIS isn't able to do what I want with native functionality so I'm coming to you as a very novice novice.

<request>
<SrqNo>1234</SrqNo>
<SeqNo>1</SeqNo>
</request>


I need to get the two values from the 2 elements into 2 string variables. Sounds simple yes. I can do this in SQL in seconds so thought it would be a few minutes work yet hours later all i've managed to do is to using xmlreader pop up a messagebox displaying 'root' then 'SrqNo' then '1234' then 'SeqNo' then '1'...

very pretty but gets me nowhere.

* In my code the above xml will come from a string variable not a document.

* I want to use intended xml functionality as in future packages the xml may be more complex.

* I need to end up with 2 string variables; the 1st containing '1234' and the 2nd containing '1'.

Simple as that?

Cheers guys



Report
Re: Get Specific Element Value From XML String Posted by seancampbell on 21 Jan 2011 at 2:55 PM
Hey chrissyboy,

Check out this forum thread for how to pass a string to the XMLReader object... http://social.msdn.microsoft.com/Forums/eu/xmlandnetfx/thread/2aad018f-7af1-41c3-bfa1-8691eed0eb38

You should be able to find ample tutorials with a simple google search. If you are still having problems, you can email me directly (find my contact information in the Sticky Thread I stuck up top of this forum).

Happy coding,
Sean Campbell - Firesickle



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.