1

Looked at a few examples to insert data(links below) but dont see the syntax to reference the destination table.

Whats the LINQ to SQL version of INSERT INTO Table2 based on SQL code below?

--append to table
INSERT INTO table2
SELECT * FROM table1

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/insert-update-and-delete-operations

Vinh Ton
  • 107
  • 3
  • 10
  • 1
    Linq itself is not a database technology. There are implementations that use Linq in coordination with data access - like Linq to SQL and Entity Framework. You will probably prefer Entity Framework for which you should be able to Google plenty of resources. – Crowcoder Sep 21 '17 at 17:37
  • Possible duplicate of [How can I insert all rows from one table into another table with Linq-to-SQL?](https://stackoverflow.com/questions/31238393/how-can-i-insert-all-rows-from-one-table-into-another-table-with-linq-to-sql) – djangojazz Sep 21 '17 at 18:28
  • Thanks for clarifying @crowcoder, I think I mean Linq to SQL – Vinh Ton Sep 21 '17 at 19:32
  • @VinhTon, that's fine, but know that Linq to SQL has generally fallen out of favor and all but replaced by Entity Framework. It's a matter of opinion (LINQPad still uses it) but if you are going to learn something, EF is more transferable knowledge. – Crowcoder Sep 21 '17 at 19:40
  • @Crowcoder, definitely good to know! LINQPad is my exploration to go beyond SQL so I am concerned if its worth it in the long run. I'll start a separate post to solicit recommendations – Vinh Ton Sep 21 '17 at 20:59

0 Answers0