Image1.ImageUrl = "HandlerLogo.ashx?company_id=" + comp_id;
MemoryStream memoryStream = new MemoryStream(); SqlConnection connection = new SqlConnection(GetConnectionString()); string sql = "select company_logo from Recruiter_RegisterLogin where company_id=@company_id"; SqlCommand cmd = new SqlCommand(sql, connection); cmd.Parameters.AddWithValue("@company_id", id); connection.Open(); SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); byte[] file = (byte[])reader["company_logo"]; reader.Close(); connection.Close(); memoryStream.Write(file, 0, file.Length); context.Response.Buffer = true; context.Response.BinaryWrite(file); memoryStream.Dispose();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)