Click here to Skip to main content
15,901,721 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a file im pulling data from which loads into a data grid view. When its loading it locks the application up and i need to be able to use the application while its loading. Below is how im loading the rows:
VB
DgwApping.rows.add(name, address, size, date, status)


i know that a background worker has a progress method but it only lets me add one item and the progress status. how can i load an entire row from a background worker? Thanks for the help.
Posted
Updated 25-Jul-12 13:59pm
v2

1 solution

If you're using the file system, then while the file is open in one thread, no other thread can open it. This is why it's better to use a database. Alternatively, read the whole file in to memory and then process it there, instead of keeping the file open. Of course, you don't want each thread to read in a monolithic file, so if it's rarely changing, you're better off making it a static property on the site, and perhaps writing code that checks the last changed date against one you store, to see if it needs reloading.
 
Share this answer
 
Comments
Zachary.shupp 25-Jul-12 20:22pm    
This file change frequently and we check it on different machines. I just need to find someway to pass multipe items throgu the progresschanged event. I have tried creating a list but it dosent like that.
Christian Graus 25-Jul-12 20:46pm    
You could pass a string as XML if all else fails ? It does sound like your file should be data in a DB. You should post the actual code that reads the file if you want more specific advice.
Zachary.shupp 25-Jul-12 21:10pm    
Could u give me an example
Christian Graus 25-Jul-12 21:11pm    
An example of what XML is ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900