0

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.

Anders Abel
  • 67,989
  • 17
  • 150
  • 217
Nate Pet
  • 44,246
  • 124
  • 269
  • 414

1 Answers1

2

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();
Anders Abel
  • 67,989
  • 17
  • 150
  • 217