Avatar of cycledude
cycledudeFlag for United Kingdom of Great Britain and Northern Ireland asked on

querying a list of classes

Hi

I have an application that is working, but an operation which is querying a database many times, is performing slowly.. so I need to alter the code to work from memory rather than the database.

I am loading the required data into a list of classes, for sake f example the class contains data for employees.

What I need to do is pull a set of data from the list, as if I was querying a database... for example, I would like to extract a new list which contains all employees with the surname 'Jones'


How can I do this?
C#

Avatar of undefined
Last Comment
cycledude

8/22/2022 - Mon
Easwaran Paramasivam

Implement Cache mechanism. You did not mention that is windows or web application?

However please do refer below links:

http://www.codeproject.com/Articles/12097/Cache-Management-in-ASP-NET
http://www.codeproject.com/Articles/7670/How-to-use-data-caching-in-a-NET-Windows-Forms-app

If you want use SQLite.  Refer: http://www.sqlite.org/sharedcache.html

However increasing SP performance would always help you.
Guy Hengel [angelIII / a3]

>but an operation which is querying a database many times, is performing slowly..
>so I need to alter the code to work from memory rather than the database.

hmmm, I would first check if the query could not be tuned ...
often, just a little small index will work terribly good.

do you have some details?
SOLUTION
APoPhySpt

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
cycledude

HI

Sorry i was in a rush when typing the question... It is a c#2010 winforms application, connecting with an access database.

I figured that LinQ would be the way to go...
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
cycledude

thanks