I have a SQL Server table with a Varbinary(Max)
column that is basically compressed data.
My page allows users to download this data (after usual user authentication).
It used to work ok, with smaller data size, but now with time, the data is also getting bigger. I am facing lot of problems basically a wait time, before the Save dialog appears.
Code:
while (reader.Read())
{
Response.Buffer = false;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/gzip";
Response.AddHeader("content-disposition", "attachment;filename="
+ "vbet_1_1.sdf.gz");
byte[] bytes = (Byte[])reader["backupdata"]; // STUCK HERE
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
}
In the debugger, I can see that
byte[] bytes = (Byte[])reader["backupdata"];
is where that lag is.
My platform is ASP.Net with .NET Framework 4.0, SQL Server 2008, C# codebehind