Hello , I am making a project on railway reservation system in which if a user wants to cancel his ticket , he should enter his phone number and ticket number , after that he ticket will get cancelled . The problem I am getting is that it is displaying that your ticket has been cancelled but t is not actually deleting the record from the database . Phone is string and Tnumber is in numeric . Thank you !
Code:
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim okToDelete As MsgBoxResult = MsgBox("Are you sure you want to cancel your ticket?", MsgBoxStyle.YesNo)
        If okToDelete = MsgBoxResult.Yes Then
            Dim str As String
            str = "Delete from Table2 Where Phone = ' " & TextBox1.Text & " ' and Tnumber= " & TextBox2.Text
            Dim cmd As OleDbCommand = New OleDbCommand(str, Conn)
            Try
                cmd.ExecuteNonQuery()
                cmd.Dispose()
                Conn.Close()

                MsgBox("Your Ticket Cancelled Sucessfully ! ")
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        ElseIf okToDelete = MsgBoxResult.No Then
        End If

        Form3.Show()
        Me.Close()
    End Sub