trying to delete selectedItem from combobox to remove selectected account from database using mysql and vb.net 2008....this is my code for my delete menu can anyone help?
***************************************************
Public Class delete
Public Sub _load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'ProbillernewDataSet.customer' table. You can move, or remove it, as needed.
Me.CustomerTA1.Fill(Me.ProbillernewDataSet.customer)
End Sub
Private Sub bntCancle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntCancle.Click
Me.Close()
End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
'delete selected row from database
Dim Ans As MsgBoxResult
' Set icon to exclamation mark
' Set buttons to OK and Cancel
' Show Message Box
Ans = MsgBox("Are you sure you want to Delete Selected Account?", vbYesNo + vbExclamation, "Yes or No")
' If the user clicked no exit sub
If Ans = vbNo Then
Exit Sub
End If
'if the user clicked yes then delete selected row from database
If Ans = vbYes Then
Dim account_number As String
account_number = CBAccountNumber.SelectedItem(0)
'Dim i As String
'CBAccountNumber.Text = CBAccountNumber.SelectedItem(0)
'i = CBAccountNumber.SelectedItem(0)
Dim mysql As String
mysql = "SELECT * DELETE FROM customer WHERE account_number="""
' selects dependent record from Contacts, deletes then refreshes
End If
Me.Close()
End Sub
End Class