Confer M
Confer M
namespace refer { public partial class hello : System.Web.UI.Page { SqlConnection con; SqlCommand com; SqlDataReader reader; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=I:\vs1\lessons\refer\refer\App_Data\Database2.mdf;In tegrated Security=True;User Instance=True"); } protected void Button1_Click(object sender, EventArgs e) { con.Open(); com = new SqlCommand("select Password from table2 where Username='"+usernametxt.Text +"'", con); reader = com.ExecuteReader(); //Label4.Text = reader[0].ToString(); reader.Read(); if (reader[0].ToString() != TextBox2.Text) { Label3.Visible = true; } else { Label4.Text = " welcome " + usernametxt.Text; } } } }