Simple walk through of xmlreader, DOT NET Programming

Explain simple Walk through of XmlReader.

In this part we will do a simple walkthrough of how to use the "XmlReader" class. The Sample for the same is available in both languages (i.e. in C# and VB.NET) which you can find in "WindowsApplicationXMLVBNET" and "WindowsApplicationCSharp" folders. The Task is to load "TestingXML.XML" file and display its data in a message box. You can find "TestingXML.XML" file in "BIN" directory of both folders. Below is the display of the "TestingXML.XML" file and its content.

1137_XML reader.png

Figure: - Testing.XML Data

The both projects have command button "CmdLoadXML" which has the logic to load the XML file and display the data in the messagebox. I have pasted only the "CmdLoadXML" command button logic for simplicity. Following are some basic steps done:-

(i)Declared the "XMLTextReader" object and gave the XML file name to load the XML data.

(ii)Read the "XMLTextReader" object until it has data and concatenate the data in the temporary string.

(iii)Finally display the similar in a message box.

2402_XML reader1.png


Figure: - VB.NET code for XMLReader

Same holds true for C# code as shown below:

1295_XML reader2.png

Figure: - C# code for XMLReader

718_XML reader3.png

Figure: - Data Display for "TestingXML.XML"

Posted Date: 9/25/2012 3:02:21 AM | Location : United States

Related Discussions:- Simple walk through of xmlreader, Assignment Help, Ask Question on Simple walk through of xmlreader, Get Answer, Expert's Help, Simple walk through of xmlreader Discussions

Write discussion on Simple walk through of xmlreader
Your posts are moderated
Related Questions
Write a C# program (C# console application) that plays a word game with the user. The program should ask the user to enter the following: • His or her name • His or her age

Encripter-Decripter application Project Description: I want an application which can encrypt - decrypt text, images, and music files as well as videos. Skills required are

It's never told  to distribute complete implementation at client, due to following shown  reasons:- 1) Anyone can use ILDASM and decrypt your logic. 2) It is a bad architectu

How is a property designated as read-only?  In VB.NET: Public Read-Only Property Property Name  As Return Type Get ?Your Property execution goes in here End Get End Property.

Google Calendar Project Description: I require to syn my Microsoft exchange calendar with the Google calendar so i will view the all the changes that happen in Microsoft exch

create a table using class file

Slide Bettween Window Application 1 Project Description: Like Mouse Gesture. Keep Right Mouse, Slide Left and drop right mouse. Move to earlier app on taskbar. Keep Lef

In what order do the events of an ASPX page execute. As a developer is it important to understand these events?   If you try to access it in Page_Load that is way previous than

What is Difference between NameSpace and Assembly? Following are the differences among namespace and assembly: Assembly is physical grouping of logical units, Namespace, log

I need Kinect Developer c++ We are creating a fitting room with Kinnect and I need some questions answered like how to detect if a person turns around, how to make the clothing