protected void Button1_Click(object sender, EventArgs e) { con.Open(); string qry = "select uname,pass from usertab"; SqlCommand cmd = new SqlCommand(qry, con); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { if (lbuser.Text.Equals(dr[0].ToString()) && (TextBox1.Text.Equals(dr[1].ToString()))) { SqlCommand cmd1 = new SqlCommand("update usertab set pass='" + TextBox2.Text +"' where uname='"+ lbuser.Text + "' ",con ); //cmd1.ExecuteNonQuery(); Response.Write("<script>alert('Password Changed')</script>"); } else { Label5.Visible = true; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)