Programming for Everybody: Login form access database vb.net

Login form access database vb.net

  Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\gamal\Pictures\aa.mdb")
        Dim cmd As New OleDbCommand("select* from login1 where user1=@userl and pass1=@pass1", conn)
        cmd.Parameters.Add("@userl", OleDbType.VarChar).Value = TextBox1.Text
        cmd.Parameters.Add("@pass1", OleDbType.VarChar).Value = TextBox2.Text
        Dim adapter1 As New OleDbDataAdapter(cmd)
        Dim table As New DataTable
        adapter1.Fill(table)
        If table.Rows.Count <= 0 Then
            MsgBox("Error username or password")
        Else
            MsgBox("login successfully")
        End If




No comments:

Post a Comment