本文整理匯總了VB.NET中System.Data.DataTableCollection類的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataTableCollection類的具體用法?VB.NET DataTableCollection怎麽用?VB.NET DataTableCollection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DataTableCollection類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: GetTables
Private Sub GetTables(dataSet As DataSet)
' Get Each DataTable in the DataTableCollection and
' print each row value.
Dim table As DataTable
Dim row As DataRow
Dim column As DataColumn
For Each table In dataSet.Tables
For Each row In table.Rows
For Each column in table.Columns
If Not (row(column) Is Nothing) Then
Console.WriteLine(row(column))
End If
Next
Next
Next
End Sub
Private Sub CreateTable(dataSet As DataSet)
Dim newTable As New DataTable("table")
newTable.Columns.Add("ID", Type.GetType("System.Int32"))
newTable.Columns.Add("Name", Type.GetType("System.String"))
dataSet.Tables.Add(newTable)
End Sub