Я пытаюсь обновить представление данных после добавления новой записи.
Следующая кнопка расположена в форме, а представление данных в другой форме:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Dim dt As New DataTable
Using DBCon As New SqlConnection("Server=192.168.1.4,1433;Database=example;User=test;Pwd=test;"),
DBCmd As New SqlCommand("INSERT INTO Jobs (Zone,Equipement,Description)
VALUES ( '" & TextEdit1.Text & "','" & TextEdit2.Text & "','" & TextEdit3.Text & "') ", DBCon)
DBCon.Open()
dt.Load(DBCmd.ExecuteReader)
mainform.GridControl1.DataSource = dt
End Using
MsgBox.Show("Record Has been Added Successfully!!")
DialogResult = DialogResult.OK
Catch ex As Exception
MsgeBox.Show(ex.Message)
End Try