Link to home
Start Free TrialLog in
Avatar of Brothernod
Brothernod

asked on

vb.net handling databases efficiently (shouldn't be that hard)

I have a friend who I am writing a database application for.

The problem is that the application runs fine on my 3.5ghz machine, and even on a 1ghz machine he tested it on, but his laptop is like a p3 500 or something crazy slow like that.

I am specifically having a problem where it seems to fall behind after 2 seperate database calls in the same function.

Any ideas on how to make the program pace itself  so that it doesn't run into problems like this?


The other question is this.  My application is a bunch of tabs, each tab has a combobox populated from the db, and selecting an item on the combobox populates a listview.  Each time I select the tab it updates the combobox.  Each time I make a call to the database I open the connection, initialize it, querry it, close connection and trash the object.  Is this the best way to do it or should I open the database connection say at the start of the program and close it at the end?  


Please help.
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brothernod
Brothernod

ASKER

I'm sorry I completely forgot to mention that.  The database is MS Access and will be single user.  Currently the database will have 300 records or so and may grow by 500 to 1500 records each year.  Maybe a little faster, but not fast enough to be a problem for access.
And the database will be local to the computer.
In that case, I would definitely go down the "load all data at the start" route.  I've got an app in a similar single-user same-machine MSAccess db scenario that happily handles eight tables, some (albeit only two-fields) with >35k records, on this basis on a really old laptop - < 200 Mhz, I think, with only 64Mb RAM.

Roger
I say "happily handles".  It's slow - but that's not the program's fault ;-)

Roger
Unfortantly that sounds like a decent rewrite of the app lol.  I have a data access class I'm using but I don't know if i'll be able to convert it to deal with this change.

No big deal :) The bigger deal is learning to do threads so I can have the timer for backup, and learning to work with and querry datasets.

But that should all come from searching the site.

Thank you.