Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'DataGrid 增加行
Me.DataGridView1.AllowUserToAddRows = True
Me.DataGridView1.Rows.Add()
Me.DataGridView1.AllowUserToAddRows = False
Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1).Cells(0).Value = TextBox1.Text Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1).Cells(1).Value = TextBox2.Text
Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1).Cells(2).Value = TextBox3.Text
............................
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'更新
Dim b As New SqlClient.SqlCommandBuilder(dataapter)
dataapter.Update(dataset.GetChanges)
End Sub