Hi, you have uploaded the file to the server. The file name is stored in the database. Put a link in the page as
<asp:HyperLink ID="lnkDownload" Text="Download" runat="server" ></asp:HyperLink>
in the setvalue function assign the navigate url to that file as below.
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(); if (sdr["Resume"]!=DbNull.Value) { lnkDownload.Visible = true; lnkDownload.NavigateUrl = "Upload/" + Convert.ToString(sdr["Resume"])
}else { lnkDownload.Visible = false; }
}
con.Close();
}
|