2015年5月3日 星期日

Here's an example on how to add Table to DataSet:


Dim ds As New DataSet()
Dim dt As New DataTable("MyTable")
Dim dr As DataRow
dt.Columns.Add(New System.Data.DataColumn("Column1", GetType(Integer)))
dt.Columns.Add(New System.Data.DataColumn("Column2", GetType(Integer)))


dr = dt.NewRow()
dr(0) = 1
dr(1) = 2


'continue adding rows here
'add the Row values to Table
dt.Rows.Add(dr)
'add the Table to DataSet
ds.Tables.Add(dt)