protected void Page_Load(object sender, EventArgs e) { grid(); } private void grid() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString); string query = "select Name,Photo from ImageUpdate"; SqlDataAdapter da = new SqlDataAdapter(query, con); DataTable table = new DataTable(); da.Fill(table); GridView1.DataSource = table; GridView1.DataBind(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { string filename = "select Name,Photo from ImageUpdate where Email=@Email"; Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename); string aaa = Server.MapPath("~/ProductImage/" + filename); Response.TransmitFile(Server.MapPath("~/ProductImage/" + filename)); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)