title: ASP.Net master/detail w/Databinding to DataSource objects - multi-insert with all-or-nothing principals
body: <p>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.</p>
  
  <p>For example:</p>
  
  <pre><code>Tables:    
      OrderHeader:
        Id,
        CustomerId,
        Comments,
        OrderDate,
  
      OrderLine
        Id,
        OrderId FK =&gt; OrderHeader
        ProductId,
        Quantity
  
  Markup (abbreviated):
  &lt;asp:FormView ID="uxFormHeaderInfo" runat="server" DataSourceID="headerDataSource"&gt;
   &lt;InsertItemTemplate&gt;
    &lt;%--Header Fields--%&gt;
                   .....
    &lt;asp:GridView ID="uxDetails" runat="server" DataSourceID="detailsDataSource"&gt;
    &lt;%-- Markup --%&gt;
                   .....
    &lt;/asp:GridView&gt;
    &lt;asp:Button ID="uxSave" runat="server" CommandName="Insert" /&gt;
   &lt;/InsertItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p><strong>[Edit]</strong></p>
  
  <p>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...</p>