检查ms访问数据库中的用户名和密码(checking username and password from a ms access database)
我正在创建一个LMS。 它有一个部分从数据库检查用户名和密码并授予访问权限,但我不知道如何做到这一点。代码。
{ if (uname.Text == "" || pass.Text == "") { MessageBox.Show("Fields cannot be left blank."); } else { if (uname.Text != "member") { MessageBox.Show("Username Incorrect."); } else if (pass.Text != "member") { MessageBox.Show("Password Incorrect"); } else { Form3 frm = new Form3(); frm.Show(); }现在我需要将“member”更改为我在密码数据库中输入的值。这是数据库成功链接的数据库
我如何进行读取,如果“我的数据库中的用户名”== myusername和密码相同?
I'm creating a LMS. It has a part which checks the username and password from the database and grants access but i dont know how to do that.here is the code.
{ if (uname.Text == "" || pass.Text == "") { MessageBox.Show("Fields cannot be left blank."); } else { if (uname.Text != "member") { MessageBox.Show("Username Incorrect."); } else if (pass.Text != "member") { MessageBox.Show("Password Incorrect"); } else { Form3 frm = new Form3(); frm.Show(); }Now here i need to change "member" to the values that i have entered in the password database.Here is the database the database is successfully linked
how do i make read like if "username from my database"== myusername and same for password?
最满意答案
你可以把这样的查询
Select * from passdb where username=@user and password=@pass;对于检查空字段,您可以放置验证器。
you can put query like this
Select * from passdb where username=@user and password=@pass;for checking null fields you can put validators.
更多推荐
发布评论