how to copy columns into other table
Hi.
I am look for a smart way to copy dataColumn's form one table to an other.
I try to copy all primary key columns to an other table as foreign key
columns.
-> dtNew.Columns.AddRange(dtOld.PrimaryKey) (pseudo example)
This of cause don't work because dtOld.PrimaryKey(0).Table contains
a reference to dtAlt dataTable.
Any Idea?
Greetings TomekHi Tomasz,
The datacolumn does (with execption from a 1 column table) not exist as
dataitem.
In my opinion you have to loop through your old table to copy it.
(And do not do it direct because than you are setting the references and the
values are still in the original).
Cor
Cor Ligthert wrote:
> Hi Tomasz,
> The datacolumn does (with execption from a 1 column table) not exist as
> dataitem.
> In my opinion you have to loop through your old table to copy it.
> (And do not do it direct because than you are setting the references and the
> values are still in the original).
> Cor
>
Hi Cor.
thanks for answer :)
I did it so.
*Tomek*
Labels: ado, columns, copy, datacolum, form, key, net, primary, smart, table
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home