public void ProcessRequest (HttpContext context) { //SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString); SqlConnection cn = new SqlConnection(ConfigurationManager.AppSettings["constring"].ToString()); cn.Open(); string sql = "Select clogo from tbl_company where cid=@cid"; SqlCommand cmd = new SqlCommand(sql, cn); cmd.Parameters.Add("@cid", SqlDbType.Int).Value = context.Request.QueryString["cid"]; cmd.Prepare(); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); //context.Response.ContentType = dr["imagename"].ToString(); context.Response.BinaryWrite((byte[])dr["clogo"]); dr.Close(); cn.Close(); }
string
byte
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)