Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

If we are not returning any records from the database, which method is to be used?

1315


Define atomicity?

1008


Explain the advantage of ADO.Net?

977


Which parameter of ConnectionString is used to specify the name of the database?

1031


How do you connect to sql server database without using sqlclient?

1090


What are disadvantages of microsoft-provided data provider classes in ado.net?

1016


What is disconnected scenario in entity framework?

1092


What is partial class?

967


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

1010


Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

995


Define table relations?

962


What is the role of the dataset object in ado.net?

1097


Explain the basic use of "dataview" and explain its methods.

983


What are the steps you will take to improve performance?

883


What is difference between sqldatareader and sqldataadapter?

919