
I was totally shocked to see when my solution which I had built using Orcas Beta 2 threw errors when compiled in VS 2008 RTM!
Exploring a bit, I found that the errors generated were related to my LINQ-to-SQL classes.
Error 8 ‘System.Data.Linq.Table<Gandalf.DataAccess.Course>’ does not contain a definition for ‘Add’ and no extension method ‘Add’ accepting a first argument of type ‘System.Data.Linq.Table<Gandalf.DataAccess.Course>’ could be found (are you missing a using directive or an assembly reference?) E:\Masters Project\Entirely New\Gandalf\Source\Business Logic\Gandalf.BusinessLogic\EduTutor.cs 257 33 Gandalf.BusinessLogic
Wherever I had the “Add” method, I had error. I even created a new project and did the same thing – tried to add records to the database but couldn’t get the “Add” method.
Searching in MSDN forums, I found this
Here are the changes,
| Previous Method (Beta1 and Beta2) |
Renamed Method (VS 2008 RTM) |
| Add() | InsertOnSubmit() |
| AddAll() | InsertAllOnSubmit() |
| Remove() | DeleteOnSubmit() |
| RemoveAll() | DeleteAllOnSubmit() |
The reason given by Dinesh Kulkarni, who is the current Program Manager of LINQ to SQL is acceptable,
The original goal was to use existing Add()/Remove() pattern on collections. The problem was that the semantics is quite different – it is not like an Add()/Remove() on collection. The intent and the action is INSERT and DELETE database operations and those too only upon SubmitChanges(). This caused significant confusion on two fronts:
1. I want to INSERT or DELETE, how do I do it? Database folks kept looking for API methods with similar names
2. Why is this collection method not behaving just like a normal IList.Add()/Remove()?
Now its clear why I got those errors





Thanks for the info! Was looking for this!
Thanks for posting this. First hit on google with the answer.
Big help!
Was looking for this
Thanks