如何创建一个与sql数据库表连接的登录窗口,以验证登录详细信息。 [英] How do I make a login window that connects with a sql database table to authenticate login details.

查看:161
本文介绍了如何创建一个与sql数据库表连接的登录窗口,以验证登录详细信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个与sql数据库表连接的登录窗口,以验证用户名和密码是否正确,并检查该人是否为admin。如果他的管理员那么他/她必须查看非管理员的不同页面。我必须在Windows窗体中执行此操作。

I want to make a log in window that connects with a sql database table to authenticate that user name and password is correct and to check if the person is admin or not. If his admin then he/she must view a different page that the non admin person. I have to do this in a Windows form.

推荐答案

如评论中所述,我建议您也进行一些搜索。基本上你会有一些控件允许用户输入你需要的数据,然后单击按钮你可以使用SqlConnection和SqlCommand类来调用你的数据库中的存储过程,传入他们输入的值,然后返回一个值来表明用户是否有效。



如果您遇到某些特定问题,请回过头来发布您目前为止所拥有的代码以及您所在的位置卡住了。
As mentioned in comments, I suggest you also do some searching. Essentially you'll have some controls that allow the user to input the data you need and then on clicking the button you can use the SqlConnection and SqlCommand classes to call a stored procedure in your db, passing in the values they typed in, and then returning a value to indicate if the user is valid or not.

If you get stuck on something specific please come back and post the code you have so far and where you are stuck.


这篇关于如何创建一个与sql数据库表连接的登录窗口,以验证登录详细信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆