Large Text Files

tbonejo

Member
Joined
Apr 22, 2005
Messages
9
Programming Experience
3-5
I am using an array to load from a text file that is about 50 megs. Loading it is fast but then transferring that to a grid is very slow. I need to present the data to the end user and do number crunching and charting with it.

Any ideas on how to load the grid faster? Do you think doing this in python would be faster?


Thanks,


Tom
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Multithreading maybe...
 

ryager

Member
Joined
May 3, 2005
Messages
8
Location
Florida
Programming Experience
10+
Flicker Free

Hello,

Sounds like you may be dealing with a flicker or refresh issue, this is common when loading grid controls with rows, one at a time. I would create a new datatable object and fill it, then after the datatable is constructed simply set the datasource of the grid control to your new datatable.

TPM also has a good point in that you may notice a "hang" in your application as you build the datatable, this can easily be handled by using threads. As this is a complex solution, I will provide an example of creating a thread to build your datatable.


Private Sub LazyLoadMyData()
Dim tLazyLoader as new System.Threading.Thread(Addressof LazyLoader())
tLazyLoader.Start
End Sub

Public Sub LazyLoader()
''' Place the code here to build your DataTable Object
End Sub


Richard Yager
http://www.systems-exclusive.com
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,319
Location
Sydney, Australia
Programming Experience
10+
Whenever using a background Thread to do work, I think it is good etiquette to change the Cursor to AppStarting. Also, it's a good idea to use SuspendLayout and ResumeLayout on a visible Control when performing multiple operations on its visible elements.
 
Top Bottom