Private Sub btn_remove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_remove.Click
Dim Query As String
mysqlconn.Open()
Query = "delete from table where screen_id='" & cmb_id.Text & "' "
Dim cmd As MySqlCommand = New MySqlCommand(Query, mysqlconn)
Dim i As Integer = cmd.ExecuteNonQuery()
If (i > 0) Then
MsgBox("Record is Successfully deleted")
Else
MsgBox("Record is not deleted")
End If
mysqlconn.Close()
End Sub
我从组合框中选择 id。取决于我从数据库中删除的所选 id。上面的代码解释相同,但我想在运行时从组合框中删除已删除的 id(从数据库中删除后)
谢谢