Design the xml file for following data and show in DataGrid.

Form1.vb[Design]

Imports System.Data

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

ds.ReadXml("C:\poonam\exp 7.9 xml(2)\exp 7.9 xml\emp.xml")

DataGridView1.DataSource = ds.Tables(0).DefaultView

End Sub

End Class

Emp.xml

xml version="1.0" encoding="utf-8" ?>

<employee>

<employee e_id="1" e_name="shyam" designation="lecturer"/>

<employee e_id="2" e_name="faraz" designation="lecturer"/>

<employee e_id="3" e_name="sonali" designation="lecturer"/>

employee>

No comments:

Post a Comment