I haven't any problem about using BulkCopy.My problem is "primary key control".
Record which have new id will be insert on new row.
Record which have id on destination table will be update.
they are for datatable: bc.WriteToServer(dt, DataRowState.Added);
bc.WriteToServer(dt, DataRowState.Modified);
But I use SqlDataReader: bc.WriteToServer(dr);
Are there any ideas?
Thnks.
[quoted text, click to view] "Husam Al-A''araj" wrote:
> Hi,
>
http://www.codeproject.com/cs/database/SqlBulkCopy.asp >
> Hope this will help
>
> Regards,
> Husam Al-A'araj
>
> "Ender" wrote:
>
> > For Primary keys exception:
> >
> > bc.WriteToServer(dt, DataRowState.Added);
> > (for DataTable)
> >
> > but what do we write for DataReader?
> > bc.WriteToServer(dr,?);
> >