XML - Come creare un dataset che punta su XML





Imports System.Data

' Form to show the list of customers.

Public Class CustomerForm

Private northwindDS As DataSet

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Load the DataSet that represents the offline version of the

' Northwind database.


northwindDS = New DataSet("Northwind")
northwindDS.ReadXmlSchema(".\NorthwindCustomerOrders.xsd")
northwindDS.ReadXml(".\NorthwindCustomerOrders.xml", XmlReadMode.Auto)
northwindDS.Locale = System.Globalization.CultureInfo.CurrentUICulture

dataGridView1.AutoGenerateColumns = False
dataGridView1.DataSource = northwindDS
dataGridView1.DataMember = "Customers"
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader
End Sub

End Class










( xmlcomecreareundatasetchepuntasuxml.html )- by Paolo Puglisi - Modifica del 17/12/2023