Fast Cloning ?

I

imakowski

Is there posibility to create clone of an object without using
serialization, create instance and copy, reflection ?

I have a problem with DataColumnColection which is member of DataTable
(Columns - property). I found that constructor of Typed DataSet with
Typed DataTable takes long time :/ I tried to investigate this problem
and found that adding columns to Columns (even if I use AddRange)
(typeof DataColumnCollection) is very slow because it invokes:

this.table.UpdatePropertyDescriptorCollectionCache();
which has a loop which do the same operations n(n+1)/2 times. This loop
should be invoked only once when EndInit is invoked on DataTable :/

Creation of 1000 of typed DataSets takes me now 1,3 sec (this is very
slow because we utilize DataSets during transactions...)

So i try to found out faster way to create typed DataTable
(serialization, cloning ????) to reduce cost of constructor

Is there any way to do this ?
 
O

Ollie Riches

DataSet implements both 'Clone' & 'Copy' method does these not provide what
you want?

I am not sure how these will work with a strongly typed DataSet though.

HTH

Ollie Riches
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top