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
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;
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...
you can opt to use temp tables to view the data through a stored proc, check out the site below...

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.
dotsandcomsAuthor Commented:
good solution
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.