473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with Large data

Hi EveryBody:

I posted the following code two days ago when I face problem that my code
could not upload large data or to be prices more than 4 MB.

The code are :

Dim arrayImage As Byte() = FileUpload1.FileBytes
TextBox1.Text = FileUpload1.FileName
Dim nStr As String =
Me.TextBox1.Text.Substring(Me.TextBox1.Text.LastIn dexOf("\") + 1)
Dim scon As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Husam").ConnectionString)
Dim sql As String = "INSERT INTO MyTable(Name,Pic)" +
"VALUES(@Filename,@Picture)"
Dim cmd As New SqlCommand(sql, scon)
With cmd
.Parameters.Add(New SqlParameter("@Filename", SqlDbType.NVarChar,
50)).Value = nStr
.Parameters.Add(New SqlParameter("@Picture", SqlDbType.Image)).Value =
arrayImage
End With
scon.Open()
cmd.ExecuteNonQuery()
scon.Close()

Some body told me may be the problem are with line:

dim arrayimage() as byte=FileUpload1.FileBytes that put the whole file
content into the servermemory one and that may cause resourec problem.

And I may agree with him cause when ever i try use the above code with file
his size more than 4 Mb which is double my cache memory it stop uploading.

So Is there some one can help me in finding such way that can make me upload
large data either by spliting the file into pices and upload each pice alone
or some how?

any help or redirection will be completelly appreciated

regard's

Husam
Feb 22 '08 #1
1 1752
In the Web.config file, override the value of maxRequestLength for the
application. For example, the following entry in Web.config allows files that
are less than or equal to 8 megabytes (MB) to be uploaded:
<httpRuntime maxRequestLength="8192" />
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: htp://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Husam" wrote:
Hi EveryBody:

I posted the following code two days ago when I face problem that my code
could not upload large data or to be prices more than 4 MB.

The code are :

Dim arrayImage As Byte() = FileUpload1.FileBytes
TextBox1.Text = FileUpload1.FileName
Dim nStr As String =
Me.TextBox1.Text.Substring(Me.TextBox1.Text.LastIn dexOf("\") + 1)
Dim scon As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Husam").ConnectionString)
Dim sql As String = "INSERT INTO MyTable(Name,Pic)" +
"VALUES(@Filename,@Picture)"
Dim cmd As New SqlCommand(sql, scon)
With cmd
.Parameters.Add(New SqlParameter("@Filename", SqlDbType.NVarChar,
50)).Value = nStr
.Parameters.Add(New SqlParameter("@Picture", SqlDbType.Image)).Value =
arrayImage
End With
scon.Open()
cmd.ExecuteNonQuery()
scon.Close()

Some body told me may be the problem are with line:

dim arrayimage() as byte=FileUpload1.FileBytes that put the whole file
content into the servermemory one and that may cause resourec problem.

And I may agree with him cause when ever i try use the above code with file
his size more than 4 Mb which is double my cache memory it stop uploading.

So Is there some one can help me in finding such way that can make me upload
large data either by spliting the file into pices and upload each pice alone
or some how?

any help or redirection will be completelly appreciated

regard's

Husam
Feb 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e =...
0
by: steve | last post by:
I am having huge problems migrating large db’s from one server to another. I use phpmyadmin to dump the data into a file, and then migrate it to my production server. Then I try to use this:...
3
by: Trevor Hughes | last post by:
Hello All I have a database (Access 2000, running on Win 2000), which suffers from bloat over a period of time. In order to solve the problem I set the option to compact on exit. This however...
1
by: Teemu Keiski | last post by:
Hi, I have following type of scenario (also explained here http://blogs.aspadvice.com/joteke/archive/2005/01/10/2196.aspx ) We have problematic web server (wink2 Standard, 1.5GB of physical...
11
by: Brian Henry | last post by:
Well here is the problem, I have a data set with about 9,000 to 20,000 people in it in the data table "people"... I am then reading it into a list view one at a time row by row... adding each...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
0
by: sara | last post by:
Hi, this is the code of a (2005) asp page. I've a problem during the execution. When I click on "Leggi" button the javascript function "leggi1" is not done! Why? Someone can I helm me, please! ...
7
by: HeatherS | last post by:
We are having issues with our windows services using memory and never releasing it. We have one service that has a file watcher which takes an xml file, inserts some records into a database, and...
5
blazedaces
by: blazedaces | last post by:
Ok, so you know my problem, java is running out of memory reading with SAX, the event-based xml parser intended more-so than DOM for extremely large files. I'll try to explain what I've been doing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.