Re: dataset question - to preserve DB resources



That helped a lot.. Thanks.
My profiler trace shows 7 second queries were reduced to 1 second. Not bad.
Used a DataTable.

"Marina" <someone@xxxxxxxxxx> wrote in message
news:u27ZseZAGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
> Don't bother with the SqlDataReader. Get the data straight into the
> dataset
> (or datatable) using the SqlDataAdapter's Fill method, then do your
> processing.
>
> "Chris" <rooster575@xxxxxxxxxxx> wrote in message
> news:OVpZUYZAGHA.344@xxxxxxxxxxxxxxxxxxxxxxx
>>I have a procedure which runs a heavy SQL query, loops through a SQLreader
>>and closes the reader and connection.
>>
>> Within the loop, there is a lot of code/processing that must remain. I'd
>> like to open the DB connection, move the data to a dataSet or something
>> to
>> get the data in memory, and then immediately close the DB
>> reader/connection to free up DB resources. Then I can loop through the
>> dataSet and perform all the necessary work, without holding up the
>> database for other users.
>>
>> My question, using ASP.NET 1.1, can someone provide an example of this
>> approach?
>>
>> Thanks in advance.
>>
>
>
>


.



Relevant Pages

  • Re: dataset question - to preserve DB resources
    ... Get the data straight into the dataset ... >and closes the reader and connection. ... > Within the loop, there is a lot of code/processing that must remain. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: multiple DataReaders
    ... 1- I'm in a recursive function that opens a connection, issues a Reader ... also with in the loop it calls itself... ...
    (microsoft.public.data.ado)
  • dataset question - to preserve DB resources
    ... I have a procedure which runs a heavy SQL query, loops through a SQLreader ... and closes the reader and connection. ... Within the loop, there is a lot of code/processing that must remain. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Mutli Email
    ... I see your logic regarding loop action extending the time the loop takes to ... A reader will keep a connection to the database open while ... > Here's an article on multi-threading in web apps that I think will help ...
    (microsoft.public.dotnet.framework.aspnet)