Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. login authentication Help needed

login authentication Help needed

Scheduled Pinned Locked Moved C#
csharpdatabaseasp-netsecurityhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashkitt
    wrote on last edited by
    #1

    in an ASP.NET Web application, in the login page,wehn the user enters his username and password,i need to compare the entered username and password with the ones present in the database table. im using c# and sql server2000 plz help :)

    M 1 Reply Last reply
    0
    • A ashkitt

      in an ASP.NET Web application, in the login page,wehn the user enters his username and password,i need to compare the entered username and password with the ones present in the database table. im using c# and sql server2000 plz help :)

      M Offline
      M Offline
      Mohamad Al Husseiny
      wrote on last edited by
      #2

      You can authenticate users in Asp.Net by one of three ways 1-Windows Authentication 2-Forms Authentication 3-Passport Authentication In your case use Forms Authentication To tell Asp.Net to use it in configration file set authontication mode to forms

      <authentication mode="Forms">
      <forms name="MyForm" loginUrl="login.aspx" protection="All"   timeout="30"  />
      </authentication>
      

      In the Login Form Button Clich event handler you can Validate aginest Sel Server database like any SQL Query check if you have record who is name and password equal given values but be aware of sql injection attack when you build your query MCAD

      A 1 Reply Last reply
      0
      • M Mohamad Al Husseiny

        You can authenticate users in Asp.Net by one of three ways 1-Windows Authentication 2-Forms Authentication 3-Passport Authentication In your case use Forms Authentication To tell Asp.Net to use it in configration file set authontication mode to forms

        <authentication mode="Forms">
        <forms name="MyForm" loginUrl="login.aspx" protection="All"   timeout="30"  />
        </authentication>
        

        In the Login Form Button Clich event handler you can Validate aginest Sel Server database like any SQL Query check if you have record who is name and password equal given values but be aware of sql injection attack when you build your query MCAD

        A Offline
        A Offline
        ashkitt
        wrote on last edited by
        #3

        Mohamad Al Husseiny wrote: SQL Query check if you have record who is name and password equal given values I need the query to make a comparison with the values entered and the ones existing in the database. thanx alot! :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups