Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Re: ExecuteReader Blocks Inserts on a Table

Reply
 
Old 06-19-2008   #1 (permalink)
Andrew Morton


 
 

Re: ExecuteReader Blocks Inserts on a Table

Charles Law wrote:
Quote:

> I have a sproc that returns data from a table using a simple SELECT.
> There are quite a few rows returned, e.g. ~150,000.
>
> In my first application, I use a reader on the sproc and iterate
> through the rows, writing them out to a file. This takes about 5
> minutes until I close the reader.
If you are doing

while moreRecords
begin
read record
write record to file
end

then maybe the writing to disk is the slow step, so how about

while moreRecords
begin
read record
append record to stringbuilder
end
write stringbuilder to file

?

I take it getting the sp to write to a file is not an option?

Andrew



My System SpecsSystem Spec
Old 06-19-2008   #2 (permalink)
Charles Law


 
 

Re: ExecuteReader Blocks Inserts on a Table

Hi Andrew

Because of the speed of the connection, I think the extended times are
simply because of the time it takes to transfer that many records down the
wire. The file write is almost certainly not the slow bit.

If the sproc were to create the file then it would end up server-side, and I
need it client-side. Copying it would take much longer than the current 5
minutes.

Charles


"Andrew Morton" <akm@xxxxxx-press.co.uk.invalid> wrote in message
news:6bupvpF3bsrauU1@xxxxxx
Quote:

> Charles Law wrote:
Quote:

>> I have a sproc that returns data from a table using a simple SELECT.
>> There are quite a few rows returned, e.g. ~150,000.
>>
>> In my first application, I use a reader on the sproc and iterate
>> through the rows, writing them out to a file. This takes about 5
>> minutes until I close the reader.
>
> If you are doing
>
> while moreRecords
> begin
> read record
> write record to file
> end
>
> then maybe the writing to disk is the slow step, so how about
>
> while moreRecords
> begin
> read record
> append record to stringbuilder
> end
> write stringbuilder to file
>
> ?
>
> I take it getting the sp to write to a file is not an option?
>
> Andrew
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Typed datasets and table table adapters components not showing inToolbox .NET General
how do you create a dynamic table/pivot table .NET General
The mail I send inserts *****spam***** in the subject line?? Vista mail
Windows Mail does not do hyperlink inserts Vista mail
not able to attach photos, only inserts directly in mail Live Mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46