Click here to Skip to main content
15,913,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to ALL...
can any one help me out in displaying the resume to the client when he clicks view ...
i retrieve using the the candidate ID(i.e email)
here is the code....


protected void Page_Load(object sender, EventArgs e)
   {

       SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["myconnection"].ConnectionString);
       string email = Session["email"].ToString();
       string query = "select resumeData,resumeContent,resumeName from Employee where email='" + email + "'";
       SqlCommand cmd = new SqlCommand(query, con);
       string strExtenstion="";
       string strName = "";
       UnicodeEncoding uniEncoding = new UnicodeEncoding();
       con.Open();
       SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.Default);
     
       if (dr.Read())
       {
       
           byte[] imagecontent1 = (byte[])(dr["resumeData"]);
           int blen = ((byte[])dr["resumeData"]).Length;

       

         
        byte[] imagecontent = uniEncoding.GetBytes(imagecontent1.ToString().Replace("-",""));
          if (!dr["resumeContent"].Equals(System.DBNull.Value))
             
         strExtenstion = dr["resumeContent"].ToString();
          if (!dr["resumeName"].Equals(System.DBNull.Value))

              strName = dr["resumeName"].ToString();



          Response.Write("<pre>");
          Response.BinaryWrite(imagecontent1);
          Response.Flush();
          Response.Close();
          Response.Write("<pre>");

       }
       dr.Close();
          con.Close();        

   }
Posted
Updated 12-Apr-11 23:26pm
v2

1 solution

I think you need to add <identity impersonate="true" /> in web.config file to restart the impersonating identity. Try that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900