If a table contains 20000 records . In a page at each time
100 records to be displayed. What are the steps u will take
to improve performance? will you use dataset or datareader?

Answer Posted / renjith t n

You need to look at ROW_NUMBER() to do this effectively.
Temp tables, cursors are to costly.

CREATE PROCEDURE myProc

@StartIndex INT
@MaxRecords INT

AS

SET @StartIndex = @StartIndex + 1

SELECT
first_name,
last_name,
middle_init
FROM
(SELECT
first_name,
last_name,
middle_init
ROW_NUMBER() OVER(ORDER BY last_name)
AS rownum
FROM
Users)
AS Users
WHERE
rownum between @StartIndex and (@StartIndex + @MaxRecords) -
1

Then we can use Dataset for best performance..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to bind the controls(best practice) comboboxes to the data in the dataset?

558


What is ado rdo dao in visual basic?

667


What is adodb dll?

520


What is oledb connection?

509


What is an ADO.Net?

566






Why is ADO.NET serialization slower than ADO ?

569


What is the default provider in ado.net?

516


Data reader read and forward only, how is it possible to get 2 tables of data at a time?

494


What is serialization and de-serialization in .net? How can we serialize the dataset object?

518


What are the different row versions available in table?

531


What is the namespaces being used to access oracle database?

519


What are the advantages of oledb compared with other classes?

2323


What is a sqldataadapter?

526


Which keyword is used to accept variable number of parameters?

687


Define bubbled event?

515