我正在Visual Studio中创建一个接受数据并将其存储到MS Access的项目。然后提供一个按钮来显示另一个表单,该表单具有来自数据库的数据的数据网格视图,并将数据表示为图形形式。成功连接数据库和软件后,按钮将停止工作,无法在文本框中输入数据,也无法关闭程序。这是我的GUI:
和我的代码:
Public Class main
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the '_QualiPool_1_1DataSet.Temperature' table. You can move, or remove it, as needed.
Me.TemperatureTableAdapter.Fill(Me._QualiPool_1_1DataSet.Temperature)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TemperatureBindingSource.AddNew()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TemperatureTableAdapter.Update(_QualiPool_1_1DataSet.Temperature)
TemperatureBindingSource.EndEdit()
MessageBox.Show("Data has been saved")
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Database.Show()
End Sub
End Class