Dim myQuery = "UPDATE table1 SET data= CONCAT (data,'" & vbCrLf & "[ " & Date.Now() & " ]" & " " & "[" & getCN() & "]" & " " & txtTelenotes.Text & "[ item1 ]" & "') WHERE id='" & txtID.Text & "'"
myCommand.Connection = conn
myCommand.CommandText = myQuery
myAdapter.SelectCommand = myCommand
Dim myData As MySqlDataReader
myData = myCommand.ExecuteReader()
txtTelenotes.Text = ""
dgvREcord.Refresh()
我尝试使用以下方法刷新DataGridView:
dgvREcord.Refresh()
但它不会从数据库加载更改。
答案 0 :(得分:0)
关闭数据连接并重新打开。
我有一个类似的应用程序,但使用tableadapters,所以我的看起来像:
Me.VictimsTableAdapter.Dispose()
Me.VictimsTableAdapter.Fill(Me.VicsDataSet.Victims)