The correct syntax is:
context.Meetings.InsertOnSubmit(meeting);
Aviad P.
2010-01-01 19:30:04
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"