FIND BUTTON CODING-
protected void Find_Click(object sender, EventArgs e)
{
string k = @"Data Source=49.50.88.43;Initial Catalog=grkistdb;Persist Security Info=True;User ID=grkistuser;Password=q2oR5w_356";
cn = new SqlConnection(k);
cn.Open();
string q = "select * from addhar where id='" + TextBox1.Text + "'";
cm = new SqlCommand(q, cn);
dr=cm.ExecuteReader();
if (dr.Read())
{
TextBox2.Text = dr["name"].ToString();
TextBox3.Text = dr["address"].ToString();
Image1.ImageUrl = "~/pics/" + dr["status"].ToString();
Label1.Text = dr["status"].ToString();
}
else
{
dr.Close();
Response.Write("Records not matched");
}
}
Comments
Post a Comment