check case sensitive while login

Last post 08-22-2007 4:54 AM by bijujoseph. 5 replies.

Sort Posts:

  • check case sensitive while login

    07-30-2007, 5:31 AM
    • Member
      69 point Member
    • bijujoseph
    • Member since 06-08-2007, 6:02 AM
    • Posts 52

    hi all,

     i am using asp.net 2.0, and both MS SQL 2000 and 2005

     i have a table -login like below

    UID             UserName             Password

      1                   test                    test

     

    i want to login to a web application using this username and password

    but, what i want is, it should be case sensitive

    a user shall be able to enter in to the application only if he enters username -test and password -test

    he shall not enter for other combinations like TesT, Test, tesT etc...

    how shall i do that?

    thanks in advance

  • Re: check case sensitive while login

    07-30-2007, 7:19 AM
    • Member
      69 point Member
    • bijujoseph
    • Member since 06-08-2007, 6:02 AM
    • Posts 52

    plz don't confuse when i said 'both MS SQL Server 2000 and 2005'

    for some application, i use MS SQL Server 2000

    and for some other application, i use MS SQL Server 2005

  • Re: check case sensitive while login

    08-01-2007, 4:44 AM
    Answer

    Hi

    The reason why the username is non-case-senitive is that in the stored procedure [dbo].[aspnet_Membership_CreateUser],  UserName is converted into all lowercase before inserting into the DB

    To change this just goto the sp and change the

    LOWER(@UserName) = LoweredUserName

    to

     

    @UserName = UserName

    make the aspnet_Users table stores the original UserName.

    Hope it helps.

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: check case sensitive while login

    08-01-2007, 4:56 AM

    How are checking for username, password in your webapplication? Are you using membership api?

    Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
  • Re: check case sensitive while login

    08-09-2007, 1:47 AM
    Answer
    • Member
      14 point Member
    • prasanthr
    • Member since 07-25-2007, 6:05 AM
    • Posts 8

     Hi,

     

    You have to use "CAST" Function in SQL statement, as follows,

    SELECT *
        FROM logintable
        WHERE CAST(LoginName  AS Varbinary(255))=  CAST('test'   AS Varbinary(255)) AND [Password] = @Password  

     

    Here the password is md5 encrypted....

     

    hope this will help you..

    regards

    prasanth 

     

     

    regards,
    prasanth
    Sr. Programmer
  • Re: check case sensitive while login

    08-22-2007, 4:54 AM
    • Member
      69 point Member
    • bijujoseph
    • Member since 06-08-2007, 6:02 AM
    • Posts 52

    hi prasanth,

    Thank you very  much

Page 1 of 1 (6 items)