XML - Lettura






Dim BookDataSet As New DataSet()

BookDataSet.ReadXmlSchema("BookDataSet.xsd")
BookDataSet.ReadXml("Books.xml")

Console.WriteLine("Relations Created:")
Dim xRelation As DataRelation
For Each xRelation In BookDataSet.Relations
Console.WriteLine(xRelation.RelationName)
Next

Console.WriteLine("Wrox Books")
Console.WriteLine("----------")
Console.WriteLine()

Dim xRow As DataRow
For Each xRow In BookDataSet.Tables("Books").Rows
Console.WriteLine(xRow("Title"))

' Obtain child rows using the KeyTitleRef relation

Dim zRow As DataRow
For Each zRow In xRow.GetChildRows("KeyTitleRef")
Console.WriteLine(" {0}", zRow("Rating"))
Next
Next
Console.ReadLine()
End Sub










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