Please report confirmed 4.1 bugs in our issue tracker at CodePlex

can't create new node using linq

11/17/2009 3:38:07 PMAvatarPeter SinkeLocation: Amsterdam, netherlandsposts: 27Karma: 47

I keep getting an error while trying to insert a new node by using Linq to umbraco.
www.grabout.com/Default.aspx

Here is the code I'm using:

 myContext = new Outpost11DataContext();
ContactFormSubmitter aSub = new ContactFormSubmitter();
aSub.EmailAddress = tbEmail.Text.Trim();
aSub.FirstName = tbFirstName.Text.Trim();
aSub.LastName = tbLastName.Text.Trim();
aSub.ContactDate = DateTime.Now;
aSub.PhoneNumber = tbPhoneNum.Text.Trim();
aSub.Remarks = tbRemarks.Text.Trim();
myContext.ContactFormSubmitters.InsertOnSubmit(aSub);
myContext.SubmitChanges();

It seems that inserting new nodes isn't implemented yet. Is this correct?
If so, is there some other way to get this to work?

11/17/2009 10:58:52 PMAvatarslaceLocation: Coogee, Sydney, AustraliaCore.posts: 569Karma: 1527
Comment with ID: 19545

It would appear you're using the NodeDataProvider. The NodeDataProvider does not support Add, Update or Delete operations.

You'd need to use an UmbracoDataProvider which supports complete CRUD operations. See my series on LINQ to Umbraco, particularly this video - www.aaron-powell.com/.../...mbracodatacontext.aspx

Please login or Sign up To post replies