hi

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2009
Posts: 1
Reputation: sadiyarani is an unknown quantity at this point 
Solved Threads: 0
sadiyarani sadiyarani is offline Offline
Newbie Poster

hi

 
0
  #1
Apr 30th, 2009
i m new in asp.net with c# .I am trying to make a C# application login on my ASP.NET page.I want the code for log In.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 13
Reputation: Poojasrivastava is an unknown quantity at this point 
Solved Threads: 0
Poojasrivastava Poojasrivastava is offline Offline
Newbie Poster

Re: hi

 
0
  #2
Apr 30th, 2009
hi..well first you need to create a table in database to be able to maintain the users who can log in...
in your application connect to the database and try the following code at your Login button..

OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDb.4.0; Data Source=F:\\QMGT.mdb;");
OleDbCommand com = new OleDbCommand("select UserId,Password From Users", con);
OleDbDataReader rd;
con.Open();
rd = com.ExecuteReader();
if (rd.HasRows)
{
while (rd.Read())
{

string s1 = rd[0].ToString();
string s2 = rd[1].ToString();
if (s1 == txtUserID.Text && s2 == txtPassword.Text)
{
Response.Redirect("Default2.aspx");
}
else
{
Label1.Text = "UserID,Password does not match Please Try again!!";
}
}
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: hi

 
0
  #3
May 1st, 2009
Originally Posted by sadiyarani View Post
i m new in asp.net with c# .I am trying to make a C# application login on my ASP.NET page.I want the code for log In.
you dont even need code for login. on the tool box you have createuserwizard and the others. use them instead.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC