protected void Page_Load(object sender, EventArgs e)
{
try
{
string selectSQL = "select name,gender,Designation,Deptt,Location,dob,emailid from empbirth where userid='" + txtempcode.Text + "'";
SqlCommand cmd = new SqlCommand(selectSQL, cnn);
SqlDataReader dr;
cnn.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
{
txtname.Text = dr[0].ToString();
txtgender.Text = dr[1].ToString();
txtdesignation.Text = dr[2].ToString();
txtdepartment.Text = dr[3].ToString();
txtlocation.Text = dr[4].ToString();
txtdob.Text = dr[5].ToString();
txtEid.Text = dr[6].ToString();
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}