Loading database in the background
Hi,
I am loading an access database in vb.net using
Code:
me.adaptername.fill(me.datasetname.tablename)
The thing is that this takes a lot of time and the program doesn't move on to the next line until it finishes loading all the data. Some of these tables I need only later but I don't want to make stall work while doing it. Is there a way to load a database without waiting for it in the code. and a way to check if it finished loading in code. this way i'll be able to load it in the backgroud after the program has started and if the user wants to use options which require tables which weren't loaded yet i'll be able to know and avoid errors.
Thank you.
Blacknight
Re: Loading database in the background
Hello Balcknight,
Couple of Questions are in my mind.
1. Why are you loading entire database at a stretch instead of loading what ever the tables you required. It not only increases the performance of the app, but also reduces the memory consumption/cpu utilization of the System.
2. Why do you want to load it when user really doesn't required that. You can load the data when really user needs it.
And for your question, "Is there a way to load a database without waiting for it in the code", You can use Threading concept. Create a separate thread and give its the job of loading data, it will loads the data on one hand and you can start running of your program on the other end.
Happy Coding,
Naga..