I wasn’t able to find any good examples on Google (they were all for old CTPs).
So to all that this may help, this is how you can insert a record into SQL using Linq (LinqToSQL).
NorthWindDataContext db = new NorthWindDataContext(); Product prod = new Product(); prod.ProductName = "The Dave Special"; prod.CategoryID = 1; prod.UnitPrice = 24; prod.UnitsInStock = 1; //This is the line I kept missing db.Peoples.InsertOnSubmit(prod); db.SubmitChanges();
Shoutout to Jordan for helping me with this
August 10, 2009 at 6:24 pm
Hey, its so simple but i was having the hardest time doing exactly this… your a lifesaver… maybe thats a little to extreme. Your a timesaver… and a lifesaver.
thanks again!!!