Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 19, 2008 02:18 AM by Paul Linton
Jun 18, 2008 08:28 PM|LINK
If the form displays data from just one model, saving is easy using Table.InsertOnSubmit(entity) then SubmitChanges. However, what if you have to save data to more than on related tables? Is there an easy way to do this? Does my question make sense?
Jun 18, 2008 10:40 PM|LINK
This lies firmly outside the scope of MVC. it depends completely on your BLL/DAL.
So what are you using for your back end? Entity Framework? Linq to Sql classes? SubSonic? your own custom thing?
Either way, you should ask the question on the appropriate forum.
Jun 19, 2008 02:18 AM|LINK
You can have multiple InsertOnSubmit calls like this
The SubmitChanges collects all the changes you have specified and executes SQL to commit them to the database.
If you haven't set any TransactionScope then the changes are wrapped in a new transaction (so a failure of any one of the inserts will cause none of the inserts to happen)