Click here to Skip to main content
13,045,657 members (52,172 online)
Rate this:
Please Sign up or sign in to vote.
hi all
i want creat a login page with 2text box username and password 1button for enter
after clicking in button check the 2textboxt if they exist in database enter if they aren't show the note
and I want post back the IP of the pc who requst
I want do It with store procedure plz help me Im new & I confused
Posted 23-Apr-13 22:41pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is the best place to start - Google Search - login[^]

Login control is a very common requirement in any web application. So the feature was available out of the box with ASP.NET 2.0
Read through the MSDN links and implement it in your project. It has everything you want.

Hope this helps!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can implement this something like:

SqlConnection conn = new SqlConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["leave"].ConnectionString;
            string uname = TextBox1.Text;
            string ps = Textbox2.Text;
            SqlCommand cmd = new SqlCommand("Select uname, pswd from emp_details where uname =@uname and pswd =@ps", conn);
            cmd.Parameters.Add(new SqlParameter("@uname", "db username here"));
            cmd.Parameters.Add(new SqlParameter("@ps", "db pasword here"));
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
                label1.text=Server.HtmlEncode(Request.UserHostAddress);/*Gives you the ip address as string*/
                /*Perform operations for authinticated user*/
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I cant do it yet i read many opensource code & I try all of them but none of them was usefull
Ankur\m/ 26-Apr-13 6:10am
Reporting 'Not an Answer'. Please use comment feature to discuss with an answerer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 25 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100