December 2001
Beginner
976 pages
22h 4m
English
The XML content and XML Schema generated from a DataSet can also be saved to files. There are convenient methods on the DataSet for providing this capability. These methods are WriteXmlSchema and WriteXml.
The following example again shows loading a DataSet from the authors table:
Imports System.Data.SqlClient Imports System.Data.Common Module Module1 Sub Main() Dim query As String = "select * from authors" Dim connStr As String = "Initial Catalog=pubs;Data Source=localhost;" & _ "Integrated Security=SSPI;" Dim conn As SqlConnection = New SqlConnection(connStr) Dim adapter As SqlDataAdapter = New SqlDataAdapter(query, conn) Dim ds As DataSet = New DataSet() adapter.TableMappings.Add(New DataTableMapping("Table", ...Read now
Unlock full access