473,320 Members | 1,572 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,320 software developers and data experts.

bigger buffer corrupts file

Hi, I am really done. What is wrong with this simple code? Buffer with size
smaller than about 500 works. But bigger buffer results in corrupted file.
Generated file is bigger than the original (about 10 kB). Why? File is stored
in MS SQL server 2000. Thank you. Tom
if (dr.Read())
{

startIndex = 0;
this.retval = dr.GetBytes(2,startIndex,buffer,0,this.bufferSize) ;

while (this.retval == this.bufferSize)
{
Response.BinaryWrite(this.buffer);
Response.Flush();
this.startIndex += this.bufferSize;
this.retval = dr.GetBytes(2,startIndex,buffer,0,this.bufferSize) ;
}
Response.BinaryWrite(this.buffer);
Response.Flush();

Response.End();
}
dr.Close();

Nov 18 '05 #1
0 1094

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

Similar topics

5
by: neo002244 | last post by:
The move_uploaded_file() function is very quirky. I want to allow users to upload images to the Web site. Here is the code: if(!move_uploaded_file($_FILES, $imagefile)) { die("Could not move...
4
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many...
1
by: ad | last post by:
I new a buffer for read file: How to detriminate the BolockSize when new the buffer? ...
6
by: owengoodhew | last post by:
Hi, I am responsible for maintaining an MS Access 97 Database that reliably becomes corrupt following a compact......... About the Database: The database is made up of three linked databases,...
0
by: Pedro Lucas via .NET 247 | last post by:
I have a weird .RC corruption problem with MSVC .NET 2003. I have a .RC file that has been in use for years with .NET inside a project called Netcount. Recently I upgraded to .NET 2003 and...
5
by: z. f. | last post by:
hi, i have a vb.net web application and i make a request using internet explorer to an aspx page. the aspx page size if over 170KB, and the page in internet explorer looks truncated and in the...
3
by: scorro1 | last post by:
Hey guys, I am working on a program which is supposed to read input from a file at 100 chars per time, then change the spaces to underscores and reverse the order of the entire document. Now we...
6
by: Deano | last post by:
Every once in a while I modify one particular form (could be anything from adding code to tweaking properties as far as I can see) and upon loading I get; "You can't assign a value to this...
10
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... We've been trying to migrate our asp.net apps off older, underpowered hardware to newer, bigger boxes but when we do, we see our databases start to melt. When I started to look into it,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.