Registered data disappear

0

The Register form registers correctly in the database and if you change user with the program open it still accesses the registered data, but how much the program completely closes and opens again all the data registered so that someone knows what it can be? obs - code below

 Private Sub Salva()

    Using con As OleDbConnection = GetConnection()

        Try

            con.Open()
            Dim sql As String = "INSERT INTO usuarios (login,senha,perfil) VALUES(?,?,?)"
            Dim cmd As OleDbCommand = New OleDbCommand(sql, con)

            cmd.Parameters.Add(New OleDb.OleDbParameter("@login", TextBox1.Text))
            cmd.Parameters.Add(New OleDb.OleDbParameter("@senha", TextBox2.Text))
            cmd.Parameters.Add(New OleDb.OleDbParameter("@perfil", ComboBox1.SelectedIndex))

            cmd.ExecuteNonQuery()

            MsgBox("Usuário Cadastrado Com Sucesso!", MsgBoxStyle.Information)

        Catch ex As Exception

            MsgBox("Ocorreu um erro ao tentar gravar um novo Usuário", MsgBoxStyle.Information)

        Finally

            con.Close()

        End Try

    End Using

    LimpaCampos()

End Sub
    
asked by anonymous 24.08.2016 / 15:01

0 answers