Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim table As New DataTable("Test")
table.Columns.Add("NO", GetType(Integer))
table.Columns.Add("Content")
table.PrimaryKey = New DataColumn() {table.Columns("NO")}
table.LoadDataRow(New Object() {1, "测试2222"}, True)
table.LoadDataRow(New Object() {2, "任意DataTable数据"}, True)
table.LoadDataRow(New Object() {3, "上传到通常用的数据库"}, True)
table.AcceptChanges()
'把table数据上传到SqlServer的Nothwind数据库
Dim db As New SqlOleDbDatabase(".", "Northwind")
db.CopyTableToDatabase(table)
Me.DataGridView1.DataSource = db.GetDataTable("test")
End Sub