My goal is to allow the user to enter order header and detail data and have it all save with a single button click, in one transaction so the save is all or nothing.
For example:
Tables:
OrderHeader:
Id,
CustomerId,
Comments,
OrderDate,
OrderLine
Id,
OrderId FK => OrderHeader
ProductId,
Quantity
Markup (abbreviated):
<asp:FormView ID="uxFormHeaderInfo" runat="server" DataSourceID="headerDataSource">
<InsertItemTemplate>
<%--Header Fields--%>
.....
<asp:GridView ID="uxDetails" runat="server" DataSourceID="detailsDataSource">
<%-- Markup --%>
.....
</asp:GridView>
<asp:Button ID="uxSave" runat="server" CommandName="Insert" />
</InsertItemTemplate>
</asp:FormView>
In the page i'd have FormView control that will contain the edit fields for CustomerId and Comments, also i'd have a nested gridview or listview that I could add line items to. The FormView and gridview controls would most likely be linked to independent datasource controls. What I want to happen is for the user to enter the header info and the line items and click save just once at the bottom of the screen.
Is this even possible using the LinqDataSource or ObjectDatasource objects? If so could you point me to a good example that shows how to do this in master/detail style insert that hits 2 or more tables with a single button click? Thanks in advance.
[Edit]
After reviewing feedback and searching around on this subject, I've concluded that datasource controls are just the wrong tool for the job. Since they can't really handle a case as pedestrian as this, it really does call into question their usefulness IMHO. So much for the new way...