How to Fixed this case task [Resolved]

Posted by Jayakumars under C# on 3/28/2017 | Points: 10 | Views : 1183 | Status : [Member] [MVP] | Replies : 1

I have 5000 Records in my Table Fields like this

Name -> Varchar
Empno - > numeric
Photo - > varbinary

so I have query for fetching Data using Select Query and Bind Datatable
In this situation My Query running long time running running some time timeout coming

How to Read this type Data Read fast?

We need Datatable to list?

How to fast reading Records and bind some collection then using loop

any one guide proper way.

Mark as Answer if its helpful to you


Posted by: Rajnilari2015 on: 3/29/2017 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50


a) check for proper indexing
b) Check the execution plan and figure out which operator is more costly.
c) If you are having parametrized stored procedure, please do consider parameter sniffing
d)Filter out the records before they participates in joins.
e)If you are performing sort, please delegate that to TEMP DB.
f)Depending upon the situation, you might consider Covering index.
g)Apply pagination in your program and instead of fetching all 5k records, pick the records on demand.

Please read the below DNF articles for more informaton

a) The Art of Stored Procedure Optimization - Part 1 ( )

b) The Art of Stored Procedure Optimization - Last but not the least ( )

You might consider using AutoMapper for converting your DTO's to the domain model. Please refer this ( ) DNF article.

hope this helps.
Let us know if you need more guidance.

Thanks & Regards,
RNA Team

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response