本文整理汇总了VB.NET中System.Xml.XmlDataDocument.CloneNode方法的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlDataDocument.CloneNode方法的具体用法?VB.NET XmlDataDocument.CloneNode怎么用?VB.NET XmlDataDocument.CloneNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了XmlDataDocument.CloneNode方法的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)
'Create a shallow clone of the XmlDataDocument. Note that although
'none of the child nodes were copied over, the cloned node does
'have the schema information.
Dim clone as XmlDataDocument
clone = CType (doc.CloneNode(false), XmlDataDocument)
Console.WriteLine("Child count: {0}", clone.ChildNodes.Count)
Console.WriteLine(clone.DataSet.GetXmlSchema())
end sub
end class