views:

164

answers:

3
+4  A: 

The correct syntax is:

context.Meetings.InsertOnSubmit(meeting);
Aviad P.
Yes, I tried and it works. Thanks!
rem
A: 

You need to add a System.Data.Linq using statement.

Randy Minder
Also, the Add() method was replaced late in the beta with InsertOnSubmit()
Randy Minder
+6  A: 

You should not be getting a debugger error. You should be getting a compile-time error as there is not a Table.Add method. Some books/blogs (cf. especially Scott Guthrie's LINQ to SQL tutorial) that went to press before LINQ to SQL was finalized will use this syntax but it was replaced by Table.InsertOnSubmit. Replace your code by the following:

context.Meetings.InsertOnSubmit(meeting);

Here is the announcement that Add was renamed to InsertOnSubmit: LINQ: "Add" renamed to "InsertOnSubmit"

Jason
Thanks Jason! And you are right, it was a compile-time error - not a run-time one. It was my incorrect using of terms, thanks for clearing!
rem