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. 2 997
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" <ro********@hotmail.com> wrote in message
news:OV*************@TK2MSFTNGP11.phx.gbl... 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.
That helped a lot.. Thanks.
My profiler trace shows 7 second queries were reduced to 1 second. Not bad.
Used a DataTable.
"Marina" <so*****@nospam.com> wrote in message
news:u2**************@TK2MSFTNGP11.phx.gbl... 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" <ro********@hotmail.com> wrote in message news:OV*************@TK2MSFTNGP11.phx.gbl...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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Patrick Kearney |
last post by:
Hi All,
I have seen this type of question raised in various groups but no one has supplied a definitive answer. I am trying to load a dataset schema that has an xs:include. Project policy is to...
|
by: Tom Jastrzebski |
last post by:
Hello everybody,
It looks like this is a known problem, but I found no solution.
Deserialization of DataSet object from XML does not preserve white space.
The same code executed under .Net...
|
by: Diego TERCERO |
last post by:
Hi...
I'm working on a tool for editing text resources for a family of software
product my company produces.
These text resources are found in a SQL Server database, in a table called...
|
by: MuZZy |
last post by:
Hi All,
I got a issue here and hope someone can help me:
Let's consider this code:
// =================== CODE START =================================
using System;
using System.Data;
...
|
by: Vik |
last post by:
A dataset is saved in session state. Then the dataset is filled out with the
new records using a dataadapter. It appears then that the dataset saved in
session state contains the new records even...
|
by: Gary Shell |
last post by:
I have jumped in to the deep end of the pool, trying out visual inheritance
of a form and have run into a snag.
I have the need to create a simple maintenance form for five identically...
|
by: jimryder |
last post by:
Hi,
The following snippet:
(ds is a populated dataset)
string sXSLT = @"C:\XML\template\template.xsl";
string sTemp = @"C:\XML\temp\temp.xml";
string sOutput = @"C:\XML\output\output.xml";...
|
by: Monty M. |
last post by:
Hello;
I was wondering if anyone can assist me with this problem. Here are
the tools I am using:
Language: C#
Database: MS SQL Server 2000
Application: Visual Studio 2005
1. I have a...
|
by: casucci |
last post by:
I do a return as XMLDataDocument in my webservice but it returns not
with the namespaces etc in them. Anyone have and example where I can
have the webservice return it as a XML. C# preferred....
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |