query optimization

Hello experts,

I am using the access database. I have one table with 20,000 records and when i am using the query select * from tablename from .aspx page with C# then system is taking too long to execute the query.

What is the best possible way to fetch the records.

Any helping hands will be greatly appreciated.

Many thanks
dotsandcomsAsked:
Who is Participating?
 
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:
You could either select less records by adding a WHERE clause or select less columns, only the ones you need, like this:

select col1, col2, col4
from tablename
where col3 > 1000;
0
 
Dale BurrellDirectorCommented:
Change to SQL Server Express :)

How long is it taking and what are you doing with the records? If you are trying to display that much data it will take a little while...
0
 
Moizsaif123Commented:
you can opt to use temp tables to view the data through a stored proc, check out the site below...

http://www.sqloptimizationsschool.com/Pages/Basic%20Concepts/Temp%20Tables.aspx
0
 
käµfm³d 👽Commented:
Have you tried compacting the file lately? Sometimes running an Access DB for a length of time can bloat the file and cause queries to slow.
0
 
dotsandcomsAuthor Commented:
good solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.