Good day Geeks can I ask for some help please. In this statement............ If MsgBox("Are you sure that you want do delete this Question ?", MsgBoxStyle.OkCancel + MessageBoxIcon.Question, "Delete") = vbCancel Then I want to disable that execution of delete command... but I don't know the command ... I tried mycommand.cancel and it's not working .... below the then before else... thank you master.
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndelete.Click
If txtqid.Text = "" OrElse txtquest.Text = "" OrElse txta.Text = "" OrElse txtb.Text = "" OrElse txtc.Text = "" OrElse txtd.Text = "" OrElse txtans.Text ="" OrElse txtstat.Text = "" Then
MsgBox("Please the question that you want to be deleted.", MsgBoxStyle.OkOnly + MessageBoxIcon.Information, "Delete")
Else
Try
conn.Open()
mycommand = New OracleCommand("delete from question where question_ID = '" & txtqid.Text & "'", conn)
mycommand.ExecuteNonQuery()
conn.Close()
If MsgBox("Are you sure that you want do delete this Question ?", MsgBoxStyle.OkCancel + MessageBoxIcon.Question, "Delete") = vbCancel Then
Else
MsgBox("Question has been successfully deleted.", MsgBoxStyle.OkOnly + MessageBoxIcon.Information, "Deleted")
End If
ListView1.Refresh()
ListView1.Items.Clear()
refresher()
txtqid.Text = ""
txtquest.Text = ""
txta.Text = ""
txtb.Text = ""
txtc.Text = ""
txtd.Text = ""
txtans.Text = ""
txtstat.Text = ""
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub