I'm using a combobox connected to my account numbers in mysql..I want to take the selecteditem and put it in the delete row string for mysql using vb.net....her is what I have so far and it wont delete the seleted..any help will do....
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(1)
Dim mysql As String
mysql = "SELECT * DELETE FROM customer WHERE account_number="""
' selects dependent record from Contacts, deletes then refreshes
End If
Me.Close()