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
I need Simple upgrades for ASP.NET site I have an existing web solution, we need a new page for creating additional features. The current website is done in C#.NET and ASP.NET.

Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

I have the working code I''m using to print the SQL table right now. I just need code to print in reverse order.

What is a class? A class explains all the attributes of objects, as well as the methods that execute the behavior of member objects. It is a comprehensive data type, which show

What is Machine.config?  Machine configuration file: The machine. config file have settings that apply to the entire computer. This file is located in the %runtime install path

What is Common Type System (CTS)? CTS is the component of CLR by which .NET Framework provides support for multiple languages because it have a type system that is common acros


They are triggered in the following order as shown below: Application_BeginRequest Application_AuthenticateRequest Application_AuthorizeRequest Application_ResolveReque

Question: (a) What is VB.NET 2005 and explain the versions of VB.NET. Name the four different types of applications that new version of VB.NET can create. (b) Using the

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