VB.Net-Informations.com
   Home      .Net Framework      VB.NET      C#                                                                      About


  How to de-serialize from an XML file to .Net Object

XML is a general purpose tag based language and very easy to transfer and store data across applications. XML Serialization is the process of serializing a .Net Object to the form of XML file or from an XML to .Net Object.

During XML serialization, only the public properties and fields of an object are serialized. The following source code shows how to de-serialize the DataSet as it is streamed from an XML file back into memory.

         VB.NET Source Code Download           Print Source Code
         How to de-serialize from an XML file to .Net Object - Download
        
C# Tutorial

Imports System.Xml.Serialization
Imports System.io
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ds As New DataSet
        Dim xmlSerializer As XmlSerializer = New XmlSerializer(ds.GetType)
        Dim readStream As FileStream = New FileStream("serialXML.xml", FileMode.Open)
        ds = CType(xmlSerializer.Deserialize(readStream), DataSet)
        readStream.Close()
        DataGridView1.DataSource = ds.Tables(0)
    End Sub
End Class

Click here to download serialXML.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 xml to DataGridView
*     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


   Home      VB.NET      C#
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
*     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
*     VB.NET DataGridView Tutorial
   Home      VB.NET      C#
More Source Code :   
Mail to :  feedback@net-informations.com
  |  Home   |  VB.NET   |  C#   |  SiteMap   |  Terms of Use   |  About   |
net-informations.com (C) 2010
All Rights Reserved. All other trademarks are property of their respective owners.