G
Guest
Hi,
In order to have my application give the best performance, I'm trying to
design my ASP.NET page where I will only have to populate my DataReader once.
It is a simple application where we accept date range from the user, and any
records in our SQL table, called SHIPMENTS, which has a value in a date
field, called EXPORT_DATE, which falls in that date range will be deleted
from the table. But the user would like to see a preview of the records
which will be deleted before he confirms that they should be deleted. So,
right now, the series of events are:
1. User enters date range and clicks OK.
2. Use DataReader and Command to generate the data which is to be displayed
for the user.
3. User clicks 'confirm' for the records to be deleted.
4. Do Step #2 again to get the data, and then iterate through the DataReader
and execute a stored procedure on each record's key to do the delete and
perform other miscellaneous operations.
Is it really necessary to execute the Command object twice, or can't the
DataReader be stored in memory and be ready and waiting for when we'll need
to access it the second time?
Thanks,
John
In order to have my application give the best performance, I'm trying to
design my ASP.NET page where I will only have to populate my DataReader once.
It is a simple application where we accept date range from the user, and any
records in our SQL table, called SHIPMENTS, which has a value in a date
field, called EXPORT_DATE, which falls in that date range will be deleted
from the table. But the user would like to see a preview of the records
which will be deleted before he confirms that they should be deleted. So,
right now, the series of events are:
1. User enters date range and clicks OK.
2. Use DataReader and Command to generate the data which is to be displayed
for the user.
3. User clicks 'confirm' for the records to be deleted.
4. Do Step #2 again to get the data, and then iterate through the DataReader
and execute a stored procedure on each record's key to do the delete and
perform other miscellaneous operations.
Is it really necessary to execute the Command object twice, or can't the
DataReader be stored in memory and be ready and waiting for when we'll need
to access it the second time?
Thanks,
John