在动态表上删除/插入INTO / UPDATE

时间:2017-01-05 19:35:33

标签: mysql vb.net

我的项目有问题。

这是我的代码:

<!-- language: lang-vb -->

Private Sub BtnSimpanMysql_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpanMySql.Click
    CbbKelas.SelectedItem = " '" & CbbKelas.SelectedItem.ToString() & "' "
    For baris As Integer = 0 To DGV.Rows.Count - 1
        konek()
        Dim hapusdb As New MySqlDataAdapter("DELETE FROM '" & CbbKelas.SelectedItem.ToString() & "' WHERE no = '" & DGV.Rows(baris).Cells(0).Value & "'", conn)
        Dim isi As New DataTable
        hapusdb.Fill(isi)
    Next baris
    DGV.Refresh()

图片1:

Tripmode

图片2:

enter image description here

我希望使用组合框选项 DELETE / INSERT INTO / UPDATE 我的数据到动态表。因此,当我在组合框中选择表名时,它将 DELETE / INSERT INTO / UPDATE

0 个答案:

没有答案