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
  1. Home
  2. Web Development
  3. ASP.NET
  4. i need coding for asp.net

i need coding for asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabase
4 Posts 4 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
    A Jebamalai Robinson
    wrote on last edited by
    #1

    i am doing project in ASP.Net as front end and SQL is my back end i need coding for username and password for login area.

    waiting for the reply

    S N 2 Replies Last reply
    0
    • A A Jebamalai Robinson

      i am doing project in ASP.Net as front end and SQL is my back end i need coding for username and password for login area.

      waiting for the reply

      S Offline
      S Offline
      sivaprakas
      wrote on last edited by
      #2

      SqlConnection con; SqlCommand cmd; SqlDataReader dr; string pvtConnStr; string trck = ""; pvtConnStr = here give ur connection String; con = new SqlConnection(pvtConnStr); try { con.Open(); cmd = new SqlCommand("select username,password from user_table", con); dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { if (UserName.Text == dr[0].ToString() && PassWord.Text == dr[1].ToString()) { Response.Redirect("Default.aspx"); } } Label2.Visible = true; Label2.Text = "InValid User Access"; } //Response.Redirect("Default2.aspx"); con.Close(); } catch (Exception ex) { Label2.Visible = true; Label2.Text = "Problem connect to Database"; } it works perfectly

      P 1 Reply Last reply
      0
      • A A Jebamalai Robinson

        i am doing project in ASP.Net as front end and SQL is my back end i need coding for username and password for login area.

        waiting for the reply

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        A.Jebamalai Robinson wrote:

        i need coding for username and password for login area.

        You are in wrong place. No one here will provide you a source code. Read forum guidelines before posting a question.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        1 Reply Last reply
        0
        • S sivaprakas

          SqlConnection con; SqlCommand cmd; SqlDataReader dr; string pvtConnStr; string trck = ""; pvtConnStr = here give ur connection String; con = new SqlConnection(pvtConnStr); try { con.Open(); cmd = new SqlCommand("select username,password from user_table", con); dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { if (UserName.Text == dr[0].ToString() && PassWord.Text == dr[1].ToString()) { Response.Redirect("Default.aspx"); } } Label2.Visible = true; Label2.Text = "InValid User Access"; } //Response.Redirect("Default2.aspx"); con.Close(); } catch (Exception ex) { Label2.Visible = true; Label2.Text = "Problem connect to Database"; } it works perfectly

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          You shouldn't just give someone a complete solution to their problem when they clearly haven't made any attempt to solve it themselves. By doing this, you are just fostering a culture of dependency and discouraging the poster from thinking for themselves.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          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