Username and Password

A

Ahmd

Pls some one help me. i have a users table in my database and a login
screen. when login button is clicked after supplying usernme password,
i want to check it from the database and if username and password is
right..then login into admin page.


Pls helpg. very urgent. I user SQL Serverf 2000 db.

thanks
 
M

Mark Rae

Pls some one help me. i have a users table in my database and a login
screen. when login button is clicked after supplying usernme password,
i want to check it from the database and if username and password is
right..then login into admin page.

Pls helpg. very urgent. I user SQL Serverf 2000 db.

How is your ASP.NET app currently querying your SQL Server? Do you use a
DAL?
 
M

Mark Rae

I use SQL Datasource to connect to sql server.

Ah...

Is it not possible to run a stored procedure to which you pass the userid
and password as parameters and which returns you the number of users which
meet those criteria...?

It the answer is 1, then the login was successful...
 
A

Ahmd

Ah...

Is it not possible to run a stored procedure to which you pass the userid
and password as parameters and which returns you the number of users which
meet those criteria...?

It the answer is 1, then the login was successful...

--http://www.markrae.net

Sorry im new to asp.net, pls can u give me sample code to do this
task. i mean a store procedure to check usernname and a password.
thanks in advance
 
M

Mark Rae

Sorry im new to asp.net, pls can u give me sample code to do this
task. i mean a store procedure to check usernname and a password.
thanks in advance

CREATE PROC CheckLogin
@pstrUserID varchar(20)
@pstrPassword varchar(20)
SELECT COUNT(*) FROM tblUser
WHERE strUserID = @pstrUserID
AND strPassword = @pstrPassword
 
A

Ahmd

CREATE PROC CheckLogin
@pstrUserID varchar(20)
@pstrPassword varchar(20)
SELECT COUNT(*) FROM tblUser
WHERE strUserID = @pstrUserID
AND strPassword = @pstrPassword

--http://www.markrae.net- Hide quoted text -

- Show quoted text -

Thank you very much for this. if you dont mind.. pls tell me, how to
pass the parameter to the stored procedure as i have never used stored
procedure before and also how to check what it retrived( i mean 1 or
0)

thanks in advance..
 
M

Mark Rae

Thank you very much for this. if you dont mind.. pls tell me, how to
pass the parameter to the stored procedure as i have never used stored
procedure before and also how to check what it retrived( i mean 1 or
0)

Please don't take this the wrong way, but database integration is absolutely
*fundamental* to any sort of web application...

I appreciate that you are a newbie - we were all newbies once - but you are
going to struggle very badly unless you acquire some very basic ASP.NET
knowledge...

I suggest you get a copy of this:
http://www.amazon.com/ASP-NET-Every...8662182-0953532?ie=UTF8&qid=1177696190&sr=8-2

and work your way through it...

Otherwise, you're going to be forever asking "What do I do next?", "What do
I do next?"...
 
A

Ahmd

Please don't take this the wrong way, but database integration is absolutely
*fundamental* to any sort of web application...

I appreciate that you are a newbie - we were all newbies once - but you are
going to struggle very badly unless you acquire some very basic ASP.NET
knowledge...

I suggest you get a copy of this:http://www.amazon.com/ASP-NET-Everyday-Apps-Dummies-Computer/dp/07645...

and work your way through it...

Otherwise, you're going to be forever asking "What do I do next?", "What do
I do next?"...

--http://www.markrae.net

Thank you for your advice.. i really appreciate you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top