Hi
I have a database(acces) with tabel questions and answers.
-->
tblquestions
questionId -> -> primary key
question -> string
tblanswers
questionId -> primary key
answerId-> primary key
answer-> string
There's a combobox with questions and a listbox with questions of the chosen answer(s).
I have already to add and show the questions, answers.
Now I wan't to delete the answer(s) (in the listbox) of the chosen questions
I have this already
pleas help
I have a database(acces) with tabel questions and answers.
-->
tblquestions
questionId -> -> primary key
question -> string
tblanswers
questionId -> primary key
answerId-> primary key
answer-> string
There's a combobox with questions and a listbox with questions of the chosen answer(s).
I have already to add and show the questions, answers.
Now I wan't to delete the answer(s) (in the listbox) of the chosen questions
I have this already
Code:
con = New OleDbConnection(providerStr & dbLoc)
con.Open()
Dim command As New OleDb.OleDbCommand("DELETE FROM Answers WHERE questionId= " & 0 & " AND answer='" & lstAnswers.SelectedIndex.ToString & "')", con)
command.ExecuteNonQuery()
con.Close()
Comment