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
What is the sequence of UML diagrams in project? At First let me say some fact about this question, you cannot implement all the nine diagrams given by the UML in one project;

Program of addition of byte type variables - C# Program Program of addition of byte type variables, i need program code for performing addition of byte type variables. Can any

Project Description: I am seeking a serious and motivated software developer that can create for me software like scanspeeder with all the functions as it has. Only thing that I

Converting temperature from Fahrenheit to Celsius - Program C# I am facing some problems in the code for Converting temperature from Fahrenheit to Celsius. Can anybody suggest

Data hiding and encryption would be done on images. Both these process should have a data hiding key and an encryption key correspondingly. Another user should be able to decrypt t

Project Description: I want very simple app in C# in visual studio Windows forms app Very simple database management app - three buttons - search , delete, add records and

I need CELL PHONE PINGING for fugitive tracking Project Description: I want an application like the following: it provides cell phone pinging(location information via gps) wi

What is shadowing? When 2 elements in a program have similar name, one of them can hide and shadow the one. Therefore in such cases the element which shadowed the main element

Checking for validity of an expression - C# Program Hello can you please provide me some examples regarding to the Checking for validity of an   expression in C#.

Hi, I have been working on Dot Net over the past few years. I would like to do online tutoring for .NET. Could you please let me know the possible oppurtunities