Vb.Net-Informations.com



     VB.NET XML Tutorial

 * How to xml to DataGridView


How to xml to DataGridView

XML is a platform independent language, so the information formatted in XML file can be use in any other platforms . The .Net technology is widely supported XML file format. The following source code shows , how to load data in a DataGridView from an XML file . Here the Dataset using an XmlReader for read the content of the XML file - Product.XML . Locate the XML file using XmlReader and pass the XmlReader as argument of Dataset. When the Dataset retrieves the data, it passes as DataSource to DataGridView .


         VB.NET Source Code Download           Print Source Code
         How to xml to DataGridView - Download
        
Vb.Net Help

Imports System.Xml
Imports System.Data
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim xmlFile As XmlReader
        xmlFile = XmlReader.Create("Product.xml", New XmlReaderSettings())
        Dim ds As New DataSet
        ds.ReadXml(xmlFile)
        DataGridView1.DataSource = ds.Tables(0)
    End Sub
End Class
		

Click here to download the input file product.xml

VB.NET XML Related Contents
*     How to XML in VB.NET
*     How to create an XML file in VB.NET
*     How to open and read an XML file in VB.NET
*     How to create an XML file in VB.NET using Dataset
*     How to open and read an XML file in VB.NET using Dataset
*     How to create an XML file from SQL in VB.NET
*     How to search in an XML file
*     How to filter data in an XML file
*     How to insert data from xml to database
*     How to create an Excel file from XML
*     How to create an XML file from Excel
*     How to create a TreevView from XML
*     How to create Crystal Reports from XML
*     How to serialization in xml
*     How to serialize a .Net Object to XML
*     How to serialize from an XML file to .Net Object

VB.Net Related Topics
*     Microsoft .Net Framework Tutorials
*     VB.NET Language Basics Tutorials
*     VB.NET Program Flow Control Tutorials
*     VB.NET Collections Tutorials
*     VB.NET String Tutorials
*     VB.NET Files Tutorials
*     VB.NET Excel 2007 Tutorials
*     VB.NET Crystal Reports Tutorials
*     VB.NET Communications Tutorial
*     VB.NET ADO.NET Tutorial with source code
*     ADO.NET Data Providers help and Tutorial
*     VB.NET ADO.NET Dataset Tutorial
*     ADO.NET DataAdapter and Dataset
*     VB.NET ADO.NET DataView Tutorial
*     VB.NET Remoting Tutorial
*     VB.NET XML Tutorial
Search here for more Vb.Net Source Code :


   Categories

    HOME
    VB.NET
    CSHARP

 
 
   













  |  Home   |  SiteMap   |  About   |
net-informations.com (C) 2010 All Rights Reserved