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
Which is faster entity framework or ado.net?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?
What are the ado.net connection pooling parameters?
What is read only and forward only in ado.net?
What is data relation in ado.net?
How can we add/remove row's in "datatable" object of "dataset"?
What is microsoft ado?
What is the difference between ADO and ADO.Net?
Is bulk insert faster than insert?
What are the key events of sqlconnection class?
What is ado.net explain with diagram?
Explain the difference between sqlcommand object and command behavior object?
How to retrieve the user id which is provided while windows authentication?
What are the data providers used in ado.net