i need coding for asp.net
-
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
-
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
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
-
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
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
-
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
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