I have converted excelfile to byte[].
now to download excel from db,following code used..
but excel file not getting popup...
code running without errors...nothin happening..why
byte[] bytevalue = (byte[])cmd.ExecuteScalar();
excelPath = System.Text.Encoding.ASCII.GetString(bytevalue);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Clear();
Response.Buffer = true;
Response.ContentType = excelPath;
// to open file prompt Box open or Save file
Response.AddHeader("content-disposition", "attachment;filename=" + excelPath);
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite((byte[])bytevalue);
HttpContext.Current.ApplicationInstance.CompleteRequest();
//Response.End();
}