Hi,
I think the problem is here(Highlighted),
Private Sub BtnHtUpdate_Click(sender As Object, e As EventArgs) Handles BtnHtUpdate.Click
Dim dt2 As New DataTable
dt2 = ds2.Tables("projenv") {problem is here}
DGVEnvHtg.BindingContext(dt2).EndCurrentEdit()
da2.Update(dt2)
End Sub
try
dt2 As New DataTable
instead of
Dim dt2 As New DataTable