Username and Password

Discussion in 'ASP .Net' started by Ahmd, May 13, 2007.

  1. Ahmd

    Ahmd Guest

    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
    Ahmd, May 13, 2007
    #1
    1. Advertising

  2. Ahmd

    Mark Rae Guest

    "Ahmd" <> wrote in message
    news:...

    > 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?



    --
    http://www.markrae.net
    Mark Rae, May 13, 2007
    #2
    1. Advertising

  3. Ahmd

    Ahmd Guest

    On May 13, 12:31 pm, "Mark Rae" <> wrote:
    > "Ahmd" <> wrote in message
    >
    > news:...
    >
    > > 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?
    >
    > --http://www.markrae.net


    I use SQL Datasource to connect to sql server.
    Ahmd, May 13, 2007
    #3
  4. Ahmd

    Mark Rae Guest

    "Ahmd" <> wrote in message
    news:...

    > 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...

    --
    http://www.markrae.net
    Mark Rae, May 13, 2007
    #4
  5. Ahmd

    Ahmd Guest

    On May 13, 5:30 pm, "Mark Rae" <> wrote:
    > "Ahmd" <> wrote in message
    >
    > news:...
    >
    > > 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...
    >
    > --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
    Ahmd, May 14, 2007
    #5
  6. Ahmd

    Mark Rae Guest

    "Ahmd" <> wrote in message
    news:...

    > On May 13, 5:30 pm, "Mark Rae" <> wrote:
    >> "Ahmd" <> wrote in message
    >>
    >> news:...
    >>
    >> > 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...
    >>
    >> --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


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


    --
    http://www.markrae.net
    Mark Rae, May 14, 2007
    #6
  7. Ahmd

    Ahmd Guest

    On May 14, 9:51 am, "Mark Rae" <> wrote:
    > "Ahmd" <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    > > On May 13, 5:30 pm, "Mark Rae" <> wrote:
    > >> "Ahmd" <> wrote in message

    >
    > >>news:...

    >
    > >> > 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...

    >
    > >> --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

    >
    > 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..
    Ahmd, May 14, 2007
    #7
  8. Ahmd

    Mark Rae Guest

    "Ahmd" <> wrote in message
    news:...

    > 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?"...


    --
    http://www.markrae.net
    Mark Rae, May 14, 2007
    #8
  9. Ahmd

    Ahmd Guest

    On May 14, 1:55 pm, "Mark Rae" <> wrote:
    > "Ahmd" <> wrote in message
    >
    > news:...
    >
    > > 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-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.
    Ahmd, May 14, 2007
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen
    Replies:
    2
    Views:
    4,222
    Joe Fallon
    Apr 18, 2004
  2. Joeri KUMBRUCK
    Replies:
    1
    Views:
    4,519
    Ben Lovell
    Aug 30, 2004
  3. AAaron123
    Replies:
    2
    Views:
    2,136
    AAaron123
    Jan 16, 2009
  4. AAaron123
    Replies:
    1
    Views:
    1,331
    Oriane
    Jan 16, 2009
  5. Shailesh Patel
    Replies:
    0
    Views:
    448
    Shailesh Patel
    Nov 8, 2006
Loading...

Share This Page