Reputation: 46242
I have a DBML where I have my table within a MVC environment.
db.TruckTable.AddObject(trucktbl);
db.SaveChanges();
It isn't working as it can't find AddObject()
pertaining to the TruckTable
. I am wordering if there is another way around this to make a table save that is in a DBML file.
Upvotes: 0
Views: 847
Reputation: 69270
With linq-to-sql the method to add objects is called InsertOnSubmit()
and saving changes is done through SubmitChanges()
.
db.TruckTable.InsertOnSubmit(trucktbl);
db.SubmitChanges();
Upvotes: 2