Jeeten Parmar
Jeeten Parmar

Reputation: 5787

DataReader or DataTable to bind Repeater?

Till now, I am using DataTable to bind Repeater. But for new Project, I want to improve its performance so I want to know that which one is better to bind Repeater, DataReader or DataTable ?

I will fetch around 20 rows at a time as I am using Custom Paging with Repeater. Should I fill data in List or use DataReader or DataTable directly as DataSource ?

Please help me choose any one for better performance. or any other better option ?

Upvotes: 0

Views: 348

Answers (2)

Yu Yenkan
Yu Yenkan

Reputation: 765

directly bind to control will better than fill in list then bind to control.

Upvotes: 0

Tim Schmelter
Tim Schmelter

Reputation: 460340

You are micro optimizing things. If you have performance issues then there is most likely something else to optimize. For example the query, why does it take a long time to query 20 rows? A DataTable is filled from a DataAdapter which also uses a DataReader so there's almost no difference.

Choose whatever you find most readable.

Upvotes: 1

Related Questions