What's the prob?? |
| shreya verma posted at 09-May-08 02:48 |
See, what's the problem out there in my code, it's not working. i tried even it with using breakpoint. while opening the page after login details are not shown on the page
Code
protected void Page_Load(object sender, EventArgs e)
{
string EmpID = (string)Request.QueryString["empid"];
if (!Page.IsPostBack)
{
txtEmpName.ReadOnly = true;
txtMySiteURL.ReadOnly = true;
txtRO.ReadOnly = true;
txtEMail.ReadOnly = true;
FileUpload1.Enabled = false;
btnUpdate2.Enabled = false;
}
SetValue(EmpID);
}
private void SetValue(string EmpID)
{
EmpID = ( string)Request.QueryString["empid"];
{
string constr = ConfigurationManager.ConnectionStrings["ConStr"].ToString();
SqlConnection con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand("Usp_SetEmpById", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue( "@empid", Convert.ToInt32(EmpID));
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
txtEmpName.Text = sdr[ "EmpName"].ToString();
txtMySiteURL.Text = sdr[ "MySiteURL"].ToString();
txtRO.Text = sdr[ "ReportingOfficer"].ToString();
txtEMail.Text = sdr[ "EMail"].ToString();
}
con.Close();
}
} |
|