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?
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