H
Husam
Hi EvereyBody:
I have the following code that I uesd to download data from my web
application:
The Code:
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 s as string="tablename"
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.ContentType = "text/HTML"
Dim husam As String = rawan(ListBox1.SelectedIndex)
Response.AddHeader("Content-Disposition", "attachment;
filename=" + husam)
Me.Response.BinaryWrite(rawan1(ListBox1.SelectedIndex))
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Message)
objconn.Close()
End Try
I found that when I load larg data for example 100Mb there is an excption
thrown told me that SystemOut of Memory, Some body told me to increae the
limt of memory I searched by my self and I found there are a section in
web.config file that called processmodel when I but the following code into
my web.config file there is a message appear and toled me :
The code In web.config
<System.web>
<processModel memoryLimit=''80"/>
</System.web>
The message:
Parser Error Message: An error occurred creating the configuration section
handler for system.web/processModel: The given assembly name or codebase was
invalid. (Exception from HRESULT: 0x80131047)
Source Error:
This is from machine Config file
Line 72: <section name="mobileControls"
type="System.Web.UI.MobileControls.MobileControlsSection, System.Web.Mobile,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 73: <section name="pages"
type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 74: <section name="processModel"
type="System.Web.Configuration.ProcessModelSection, System.Web,
Version=2.0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineOnly" allowLocation ="false"/>
Line 75: <section name="profile"
type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineToApplication" />
Line 76: <section name="roleManager"
type="System.Web.Configuration.RoleManagerSection, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineToApplication" />
I run my project in window xp sp2 os
any help will be appreciated
regard's
Husam
I have the following code that I uesd to download data from my web
application:
The Code:
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 s as string="tablename"
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.ContentType = "text/HTML"
Dim husam As String = rawan(ListBox1.SelectedIndex)
Response.AddHeader("Content-Disposition", "attachment;
filename=" + husam)
Me.Response.BinaryWrite(rawan1(ListBox1.SelectedIndex))
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Message)
objconn.Close()
End Try
I found that when I load larg data for example 100Mb there is an excption
thrown told me that SystemOut of Memory, Some body told me to increae the
limt of memory I searched by my self and I found there are a section in
web.config file that called processmodel when I but the following code into
my web.config file there is a message appear and toled me :
The code In web.config
<System.web>
<processModel memoryLimit=''80"/>
</System.web>
The message:
Parser Error Message: An error occurred creating the configuration section
handler for system.web/processModel: The given assembly name or codebase was
invalid. (Exception from HRESULT: 0x80131047)
Source Error:
This is from machine Config file
Line 72: <section name="mobileControls"
type="System.Web.UI.MobileControls.MobileControlsSection, System.Web.Mobile,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 73: <section name="pages"
type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 74: <section name="processModel"
type="System.Web.Configuration.ProcessModelSection, System.Web,
Version=2.0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineOnly" allowLocation ="false"/>
Line 75: <section name="profile"
type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineToApplication" />
Line 76: <section name="roleManager"
type="System.Web.Configuration.RoleManagerSection, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
allowDefinition="MachineToApplication" />
I run my project in window xp sp2 os
any help will be appreciated
regard's
Husam