Re: dataset question - to preserve DB resources

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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: 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)
  • Re: dataset question - to preserve DB resources
    ... My profiler trace shows 7 second queries were reduced to 1 second. ... >>and closes the reader and connection. ... >> Within the loop, there is a lot of code/processing that must remain. ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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)
  • Re: TCP listener
    ... This loop is required because of the main purpose of the program I am trying ... I am using the push server product's .Net sample and trying to modify it ... that it only works untill I close connection to the c# listener. ... private volatile bool monitorPort = true; ...
    (microsoft.public.dotnet.languages.csharp)