如何从数据库中读取值?

问题描述:


我也创建了登录页面和注册页面.现在我想从注册页面获取登录页面的用户名和密码.
如何检查数据库中的值?
任何机构都可以答复我.

Hi,
I created login page and registration page also.Now i want to take username and password for login page from registration page.
How to check that values from database?
any body reply me.

如果要将值从注册页面插入数据库.
然后在登录时验证这些值(如果找到)然后登录.
怎么做见

简单登录页面

If you are inserting values from registration page to database.
then at the time of login verify these values if found then login.
How it can be done see

Simple login page

SELECT * FROM registrationtab WHERE username=@username AND password=@password


使用存储过程查询.您只需在代码中使用此查询即可,而无需存储过程.


this query using stored procedure.You can simply use this in your code without stored proc.


编写查询以从表名中选择用户名和密码.如果用户名和密码匹配并返回行集,则该用户为有效用户,否则为无效用户.
write a query to select username and password from your tablename. If the username and password matches and returns a rowset then the user is valid otherwise invalid user.