LINQ DataContext Add method was changed to InsertOnSubmit
Posted @ Apr 12, 2008 11:12 PM | Permalink


I am new to LINQ, my second day actually, but with all those tutorials floating around the net on how to insert a record in the database and with my little knowledge on how an O/R mapper work I was pretty confident that I can code an "Insert" to the database in no time. So I went through the tutorials I found in the internet and surprisingly got stuck on how to do a simple "Insert" code. All those documents mentioned about the Add method in the DataContext but I can't find it. To be precise, there is NO Add method in the DataContext at all! Am I using an old version of Visual Studio 2008?




After several minutes of scratching my head I found a method called InsertOnSubmit. Just to make sure, I asked Mr. Google and found out that they renamed the "Add" method to InsertOnSubmit on the RTM release.



No Comments

Leave a Comment

(optional)

4 + 2 =
Enter the sum of the 2 numbers above.