Results 1 to 2 of 2

Thread: Loading database in the background

  1. #1

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381

    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

  2. #2
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    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..
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width