|
-
Feb 18th, 2010, 04:16 PM
#1
Thread Starter
New Member
DataTable clear or dispose?
Hello all,
I want to understand a situation; it's related to datatable clear().
I have a code that populate a typed datatable from Excel in a separate thread using a backgroundworker. This works well, the table is filled and I can see the data. Now, I want to clear the data from table and restart the import. The operation is ten times slower than the first time. My datatable variable is declared like this:
Private dt as new DataTable - not a local variable
I want that all subs from class to be able to use the table, that's the reason I declared the table as private.
What I want is to be able to create a new instance of dt (or clear allocated memory) - maybe this is the reason for slowdown. But I don't know how to do this. Please advice.
Thanks,
Costin
If you don't help, why are you still expecting others to help you?
-
Oct 12th, 2011, 03:45 PM
#2
New Member
Re: DataTable clear or dispose?
I'm encountering the same issue. Did you ever find a solution?
Thanks.
-Chris
-
Oct 12th, 2011, 04:27 PM
#3
Re: DataTable clear or dispose?
Start a new thread on it. Clearing the table should be faster than disposing, though only marginally, so. That isn't the problem, though, as it will take an unnoticeable fraction of a second either way. Something else is happening for the slow second read.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|