How to add a record to the database using LINQ?

I am using Scott's LINQ to SQL tutorials to try and learn LINQ. I was able to view, retrieve and update records, but I can not write new records to the database (MSSQL). Scott begins to insert lines into the fourth section of the tutorial set. As you can see on this page (or perhaps already know) to add a record, you should do the following (VB.NET):

Dim db as New LINQtoSQLDataContext Dim oArticle as New article // table name oArticle.Body = "Some Text" oArticle.Title = "Some Title" oArticle.Author = "Some Author" db.articles.Add(oArticle) // this is the line that does not work. 

Visual Studio 2008 returns me " 'add' is not a member of 'System.Data.Linq.Table(Of article) ".

Can someone give me a push in the right direction? Thanks!

+4
source share
1 answer
 db.articles.InsertOnSubmit(oArticle) db.SubmitChanges() 
+10
source

All Articles