protected void Button1_Click(object sender, EventArgs e) { MySqlConnection con = new MySqlConnection("Server=Localhost;DataBase=password1;user=root;password=nectar"); string strcon = "select data from sla11 where idSLA11=2"; MySqlCommand com = new MySqlCommand(strcon, con); con.Open(); MySqlDataReader dr = com.ExecuteReader(); if (dr.Read()) { Response.ContentType = "text/mhtml"; Response.AddHeader("Content-Disposition", "attachment;name=\"" + dr["data"] + "\""); Response.BinaryWrite((byte[])dr["data"]); Response.End(); } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Report Not Exist')</script>"); } con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)