本文整理汇总了VB.NET中System.Xml.XmlDataDocument.XmlDataDocument构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlDataDocument构造函数的具体用法?VB.NET XmlDataDocument怎么用?VB.NET XmlDataDocument使用的例子?那么, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了XmlDataDocument构造函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Sample
' 导入命名空间
Imports System.Xml
Imports System.Data
Imports System.Data.SqlClient
public class Sample
public shared sub Main()
Dim dsNorthwind as DataSet = new DataSet()
'Create the connection string.
Dim sConnect as String
sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind"
'Create a connection object to connect to the northwind db.
Dim nwconnect as SqlConnection
nwconnect = new SqlConnection(sConnect)
'Create a command string to select all the customers in the WA region.
Dim sCommand as String = "Select * from Customers where Region='WA'"
'Create an Adapter to load the DataSet.
Dim myDataAdapter as SqlDataAdapter
myDataAdapter = new SqlDataAdapter(sCommand, nwconnect)
'Fill the DataSet with the selected records.
myDataAdapter.Fill(dsNorthwind, "Customers")
'Load the document with the DataSet.
Dim doc as XmlDataDocument = new XmlDataDocument(dsNorthwind)
'Display the XmlDataDocument.
doc.Save(Console.Out)
end sub
end class