H
Husam
Hi EveryBody:
I have the following code to download the data from my web application:
the code is:
Dim rawan As New List(Of String) ' for File Name
Dim rawan1 As New List(Of Byte()) ' for the data for each file
Dim objconn As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Husam").ConnectionString)
Try
Dim objcom As SqlCommand
objcom = New SqlCommand("SELECT * FROM " + s, objconn)
objconn.Open()
Dim myread As SqlDataReader =
objcom.ExecuteReader(CommandBehavior.CloseConnection)
If myread.HasRows = True Then
While myread.Read()
rawan.Add(myread.GetValue(0))
rawan1.Add(myread.GetValue(1))
End While
Me.Response.BinaryWrite(rawan1(ListBox1.SelectedIndex))
Dim husam As String = rawan(ListBox1.SelectedIndex)
Response.AddHeader("Content-Disposition", "attachment; filename=" + husam)
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Message)
objconn.Close()
End Try
when I run this code to download small data like 4MB it works well,but when
I use it to download large data for example let's say 345 MB there is an
error occure that tell me the SystemOutOfMemory.
I read about something called MaxResponseHeadersSize Property which I
though it Like MaxRequestLength that I used before to make my application
upload large data more than 4mb, but the requirments for this proprtey is
windows 2003 or 2000 server side and windows xp clinte side.
So is there some body can help me in this problem?
any help or redirection will be apprediated
regard's
Husam
I have the following code to download the data from my web application:
the code is:
Dim rawan As New List(Of String) ' for File Name
Dim rawan1 As New List(Of Byte()) ' for the data for each file
Dim objconn As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Husam").ConnectionString)
Try
Dim objcom As SqlCommand
objcom = New SqlCommand("SELECT * FROM " + s, objconn)
objconn.Open()
Dim myread As SqlDataReader =
objcom.ExecuteReader(CommandBehavior.CloseConnection)
If myread.HasRows = True Then
While myread.Read()
rawan.Add(myread.GetValue(0))
rawan1.Add(myread.GetValue(1))
End While
Me.Response.BinaryWrite(rawan1(ListBox1.SelectedIndex))
Dim husam As String = rawan(ListBox1.SelectedIndex)
Response.AddHeader("Content-Disposition", "attachment; filename=" + husam)
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Message)
objconn.Close()
End Try
when I run this code to download small data like 4MB it works well,but when
I use it to download large data for example let's say 345 MB there is an
error occure that tell me the SystemOutOfMemory.
I read about something called MaxResponseHeadersSize Property which I
though it Like MaxRequestLength that I used before to make my application
upload large data more than 4mb, but the requirments for this proprtey is
windows 2003 or 2000 server side and windows xp clinte side.
So is there some body can help me in this problem?
any help or redirection will be apprediated
regard's
Husam