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
How to store data in memory?
What are the advantages of ado.net?
What is the use of adodc?
What is the use of connection object in ado.net?
What is the use of Dataview?
What is ado.net in mvc?
differance between ADO vs ADO.Net?
What is ado.net object model?
Define bubbled event?
Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.
how can implement dropdownlist in particular of dataset when try to update?
What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?
Why do we use sqldataadapter?
What are the methods of XML dataset object?
How do you implement locking concept for dataset?