469,319 Members | 2,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

Fast Cloning ?

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 ?

Nov 17 '05 #1
1 2146
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

<im*******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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 ?

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tom | last post: by
8 posts views Thread by Tom | last post: by
2 posts views Thread by Hendrik Schober | last post: by
3 posts views Thread by AVL | last post: by
6 posts views Thread by J Williams | last post: by
1 post views Thread by Dan Dorey | last post: by
reply views Thread by Chris | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.