Unable to cast object of type 'System.String' to type 'System.Byte[]'....
on line #2
private void download(DataTable dt) { Byte[] bytes = (Byte[])dt.Rows[0]["FileData"]; Response.Buffer = true; Response.Charset = "";
It seems to be your Table column does not contain valid binary data. Please refer my article for correct reference
Save and Retrieve Files from SQL Server Database using ASP.Net
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.