Hi naspinski, did you have a chance to try it with Linq for SQL? Thanks.
Main Topics
Browse All TopicsI need to duplicate certain elements in table and as the table is pretty long I'd rather duplicate them using linq and not assign column by column. However I'm not able to convince Linq to consider record as new. Is there any solution?
Note: .Id column is an identity based primary key.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>NewItem = ExistingItem;
I think the above would only copy the reference of the existingitem to the newitem so LINQ would consider it an existing item and give as error. I think the solution is to implement the clone interface.
Here is some more info
http://www.c-sharpcorner.c
http://edndoc.esri.com/arc
Sorry I totally forgot. Just tried it out today and found a simple way to do it. First thing you need to do is go into your dbml and set the Serialization Mode to 'Unidirectional' (see: http://www.codeexperiment.
Next, add the Clone class to your App_Code from her: http://naspinski.net/post/
Now it is simple:
Business Accounts
Answer for Membership
by: naspinskiPosted on 2009-06-22 at 00:12:51ID: 24680249
I use a Clone() extension that I talk about here: http://naspinski.net/post/ Cloning-an -Entity-in -Linq-to- E ntities.as px. It worked with Linq-to-Entities, and Linq-to-SQL is almost always easier to work with, so it should not be hard to figure out. I will try to take a look at it soon.