Windows Scripting
  Home arrow Windows Scripting arrow Visual Basic 2005 XML Programming Using XM...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Visual Basic 2005 XML Programming Using XML DOM
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-11-26

    Table of Contents:
  • Visual Basic 2005 XML Programming Using XML DOM
  • Sample XML document: source
  • Loading/Searching an XML document with XML DOM using Visual Basic.NET
  • Adding, Updating and Deleting From the XML Document with XML DOM Using Visual Basic.NET
  • Developing a complete form to work with XML DOM using Visual Basic.NET
  • Developing a complete form to work with XML DOM using Visual Basic.NET: continued

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Visual Basic 2005 XML Programming Using XML DOM


    (Page 1 of 6 )

    This article mainly focuses on manipulating XML documents using the XML API available in the .NET Framework. In simple terms, we will design a Windows Form and do all CRUD operations against an existing XML document.

    To make the article simple, I designed a Windows Form as follows.


    The entire source code for this article is available in the form of a free downloadable zip file. The solution was developed using Microsoft Visual Studio 2005 on Microsoft Windows Server 2003 Standard Edition (with SP3). I didn't really test it in any other environment. I request that you post in the discussion area if you have any problems in execution.

    Understanding the structure of the sample XML document

    Before we start manipulating the XML document, we should fully understand the content and structure of the XML document on which we are working. Let us try to understand the structure of the sample XML document from the following figure.


    The above would read something like the following:

    A company has a few departments. Each department has information about its number, name, location and a few employees working in the same. Similarly, all employee information is maintained with an ID, number, name, salary and department number.

    The starting point (say root) of the document is company (or "CompanyInfo"). All of the departments in the company are maintained (encapsulated) in a single unit named "DepartmentInfo." The "DepartmentInfo" contains a group of departments. Each piece of department information starts with a "Department" tag (or element). Every "Department" also has an "ID" as attribute and a group of elements directly beneath it. The tags "Deptno," "Dname," "Location" and "EmployeeInfo" are direct descendants of the "Department" tag. The "EmployeeInfo" contains a group of employees (along with their information). Every employee and his information ("Empno," "Ename," "Sal" and "Deptno") is embedded in a single parent element named "Employee," which is again a direct descendant to the "EmployeeInfo" element.

    More Windows Scripting Articles
    More By Jagadish Chaterjee


       · Hai,This article introduces CRUD operations to XML document using Visual Basic...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek