For Each t In ds.Tables
For Each r In t.Rows
For Each c In t.Columns
If Not r.IsNull(c) Then Console.WriteLine(r(c).ToString())
Next c
Next r
Next t
End Sub
n Overloads Public Overridable Function Add(ByVal values() As Object) As DataRow’ 如果在 ColumnChanging 或 RowChanging 事件过程中生成异常,则也可发生异常。如果发生异常,则不向表中添加行。
n Overloads Public Sub Add(ByVal row As DataRow)’ 如果用户在 RowChanging 事件中生成异常,则生成异常。如果发生异常,则不向表中添加行。
示例
Private Sub AddRow(ByVal myTable As DataTable)
Dim rc As DataRowCollection= myTable.Rows
Dim myNewRow As DataRow
Dim rowVals(1) As Object
rowVals(0) = "hello"
rowVals(1) = "world"
myNewRow = rc.Add(rowVals)
newRow = myTable.NewRow()
newRow(0) = "hello"
newRow(1) = "world"
rc.Add(newRow)
(信息整理来自MSDN)
上一页 [1] [2]
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18