HighTechTalks DotNet Forums  

How to read XML in vb.net

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss How to read XML in vb.net in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
John
 
Posts: n/a

Default How to read XML in vb.net - 12-24-2007 , 10:19 PM






Hi

I have the below XML file. How can I read each tag and its attribute in
vb.net?

Many Thanks

Regards



<Configuration>
<section name="Clients" type="Company-Contacts">
<mastertable name ="tblClients" primarykey="tblclients.id" />
<childtable name="tblClientContacts" foreignkey="tblContacts.Company_ID"
/>
</section>

<section name="Suppliers" type="Company-Contacts">
<mastertable name ="tblSuppliers" primarykey="tblsuppliers.id" />
<childtable name="tblSupplierContacts"
foreignkey="tblSupplierContacts.Company_ID" />
</section>
</Configuration>




Reply With Quote
  #2  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: How to read XML in vb.net - 12-25-2007 , 02:26 AM







"John" <John (AT) nospam (DOT) infovis.co.uk> wrote

Quote:
Hi

I have the below XML file. How can I read each tag and its attribute in
vb.net?

Many Thanks

Regards


If you're using .Net Framework 2.0, there are the Application Blocks. There
is nothing to download for the Framework it's already included in the
Framework.

However, you'll have to download the examples, which there is a section for
XML and configuration files that will allow you to pull the xml into your
application and treat them as variables. There are VB and C# examples.

<http://www.microsoft.com/downloads/details.aspx?FamilyID=5A14E870-406B-4F2A-B723-97BA84AE80B5&displaylang=en#AffinityDownloads>

There is one for .Net Framework 1.1 too, but you'll have to install that
one.




Reply With Quote
  #3  
Old   
Cor Ligthert[MVP]
 
Posts: n/a

Default Re: How to read XML in vb.net - 12-25-2007 , 02:36 AM



John,

A month ago I would have written, use the xmlnodereader.

However now Visual Basic 2008 has a new extension (not in C#, this because
this message is crossposted)

http://msdn2.microsoft.com/en-us/library/bb687701.aspx

Cor


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.