1,105,409 Community Members

How to create one login page in ASP.NET using C#

Member Avatar
Gowrishankar
Newbie Poster
13 posts since Jun 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi every one,Could you help me in creating one login page,in which the username and password get validate with the backend db(sql server)And the password is encrypted and stored in db.So I want to know how to encrypt the user inputting password and validate that one against the encryted password in db.?I want the full code...Its an immediate one....!Please help me to create....

Member Avatar
alc6379
Cookie... That's it
2,752 posts since Dec 2003
Reputation Points: 105 [?]
Q&As Helped to Solve: 154 [?]
Skill Endorsements: 4 [?]
Team Colleague
 
1
 

Sorry.

We do not do your work for you. Please post some code, and we'll help troubleshoot it.

Incidentally, if you search our forums, you'll probably find some examples of an ASP.NET login page.

Member Avatar
crash0verride
Newbie Poster
3 posts since Apr 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Sorry.

We do not do your work for you. Please post some code, and we'll help troubleshoot it.

Incidentally, if you search our forums, you'll probably find some examples of an ASP.NET login page.

well, maybe you could me some links on tutorials you know..thanks

Member Avatar
mariocatch
Junior Poster
103 posts since Apr 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 17 [?]
Skill Endorsements: 0 [?]
 
0
 

microsoft.com has tons of tutorials asp.net 2 and c#

Member Avatar
kumar.nitesh
Newbie Poster
15 posts since Apr 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

s

Member Avatar
kumar.nitesh
Newbie Poster
15 posts since Apr 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

You can use Form Authentication mode and give the connection string representing your database.Using form Authentication you can able to send userdata to db verified it and return the msg from database. Just you have to change your config file.

Member Avatar
miracle007
Newbie Poster
3 posts since Oct 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi every one,Could you help me in creating one login page,in which the username and password get validate with the backend db(sql server)And the password is encrypted and stored in db.So I want to know how to encrypt the user inputting password and validate that one against the encryted password in db.?I want the full code...Its an immediate one....!Please help me to create....

Member Avatar
sawera
Newbie Poster
1 post since Jun 2009
Reputation Points: -1 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

Hi every one,Could you help me in creating one login page,in which the username and password get validate with the backend db(sql server)And the password is encrypted and stored in db.So I want to know how to encrypt the user inputting password and validate that one against the encryted password in db.?I want the full code...Its an immediate one....!Please help me to create....

u design the form in design view by inserting the table with 5 or 6 rows and two columns.then from toolbox in the view sub menu drad and drop lebels,textboxes and buttons and set their property

Member Avatar
sumadhuri
Newbie Poster
1 post since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

reply

Member Avatar
Ryshad
Nearly a Posting Virtuoso
1,263 posts since Aug 2009
Reputation Points: 480 [?]
Q&As Helped to Solve: 247 [?]
Skill Endorsements: 14 [?]
 
0
 

There was a well written example of a login screen posted on these boards very recently.

As alc6379 mentioned, the policy at Daniweb is to show that you have made an effort before posting your problems. We will gladly offer you guidance and fixes to get your code working, but you need to do the ground work first. Especially with a topic as common as this, there are a hudnred and one tutorials, just put "C# login form" into google and start reading :)

Member Avatar
suresh kumar.k
Newbie Poster
2 posts since Jun 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
1
 

send me sourced code of login page in .net

Member Avatar
suresh kumar.k
Newbie Poster
2 posts since Jun 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

reply

at 9949920871

Member Avatar
amaninder
Newbie Poster
1 post since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

plz tell me the way of creating a registration page in c#....?????

Member Avatar
denmarkstan
Junior Poster in Training
60 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Please my problem has brought me to the good community of yours. i 've been try to write asp.net /c# code to validate user input 'pin' on the textbox in the sql database. if the pin is exist in the dbs then i delet it from the table it exist and insert it another table. only validation has been giving me sleepless night.
pls even though am new, ijust need the help of brothers. pls somebody help me out. here is the code i have been trying to work on my submit button:
DataTable pinTable = new DataTable();
try
{
SqlConnection connection = null;
string conn = ConfigurationManager.ConnectionStrings["SchooldataConnectionString1"].ConnectionString;
string found = "SELECT * FROM Allpindbs";
connection = new SqlConnection(conn);
connection.Open();
SqlDataAdapter dAdapter = new SqlDataAdapter();
dAdapter.SelectCommand = new SqlCommand(found, connection);
dAdapter.Fill(pinTable);
connection.Close();

}
catch (Exception ERR)
{

throw ERR;
}
foreach (DataRow oRow in pinTable.Rows)
{
PinCode.CompareTo(oRow["Pin"].ToString());
}
if (PinCode.CompareTo("Pin".ToString()) == 0)
{
MessageBox.Show("pin must be deleted");
}
else
{
MessageBox.Show("Invalid pin");
}
}
private void clearControls()
{
this.txtFullName.Text = " ";
this.txtRegNumber.Text = " ";
this.txtPinCode.Text = " ";
this.ddlGender.Text = " ";
this.txtLbl.Text = " ";
this.txtpassword.Text = " ";
}

}

DataTable pinTable = new DataTable();
        try
        {
            SqlConnection connection = null;
            string conn = ConfigurationManager.ConnectionStrings["SchooldataConnectionString1"].ConnectionString;
            string found = "SELECT * FROM Allpindbs";
            connection = new SqlConnection(conn);
            connection.Open();
            SqlDataAdapter dAdapter = new SqlDataAdapter();
            dAdapter.SelectCommand = new SqlCommand(found, connection);
            dAdapter.Fill(pinTable);
            connection.Close();

        }
        catch (Exception ERR)
        {

            throw ERR;
        }
        foreach (DataRow oRow in pinTable.Rows)
        {
            PinCode.CompareTo(oRow["Pin"].ToString());
        }
        if (PinCode.CompareTo("Pin".ToString()) == 0)
        {
            MessageBox.Show("pin must be deleted");
        }
        else
        {
            MessageBox.Show("Invalid pin");
        }
    }
    private void clearControls()
    {
        this.txtFullName.Text = " ";
        this.txtRegNumber.Text = " ";
        this.txtPinCode.Text = " ";
        this.ddlGender.Text = " ";
        this.txtLbl.Text = " ";
        this.txtpassword.Text = "    ";
    }

}
Member Avatar
Ryshad
Nearly a Posting Virtuoso
1,263 posts since Aug 2009
Reputation Points: 480 [?]
Q&As Helped to Solve: 247 [?]
Skill Endorsements: 14 [?]
 
0
 

Firstly, you are looping through each row but not storing the result of your test anywhere. I would suggest something like:

bool found = false;
foreach(DataRow dr in Table.Rows)
{
    if(dr["column"].ToString() == "somestring")
    {
        found = true; //store result
        break; //exit foreach loop as you no longer need to search remaining items
    }

    if(found)
    {
        //perform action based on result
    }
}

Secondly, you are using the wrong string method. IF you take a look at the msdn reference, you'll find:

Caution!

The CompareTo method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the Equals method.

Member Avatar
nareshdwivedi
Newbie Poster
1 post since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

You can use Form Authentication mode and give the connection string representing your database.Using form Authentication you can able to send userdata to db verified it and return the msg from database. Just you have to change your config file.

i tell you what i am doing

i have created a table in database that keeps username and passwords but my problem is how that table is made protected because from where i had installed sql server, thats a server and many students can work on the database as it is their subject.
is there some method so that any one can not see my database. is there some password property that could be applied to the sql server database

Member Avatar
nidhi18sep
Newbie Poster
3 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

u can use login tool from the login tool box.....

&

also u can do the coding in c sharp.

Member Avatar
afjal nathani
Newbie Poster
1 post since Feb 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

whtr u doing people plz i informed u after some bcoz now i m busy in my project

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article