Need help with Master/Detail scenario

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have what I believe to be a typical master/detail scenario. I know how to
use a transaction on the sql updates, but what about any dataset merges? My
scenario goes like this:

// call data layer to add new header record, get back auto-inc keys
// call data layer to do all updates on detail tables, assign auto-inc keys
from header where necessary
// call data layer to do update, delete operations, if necessary, on header
record

That's the sql code, which is easy enough to do in a transaction. However,
now I need to merge the datasets returned from the data layer (possible new
auto-inc, timestamp values, etc.) with the datasets on my windows form. It
would go something like:

// merge header dataset from data layer with dataset on windows form
// merge detail dataset(s) from data layer with dataset(s) on windows form

The issue I have if what if something goes wrong in one of those merge
operations? I can roll back the sql commands, but I can't "roll back" the
previous dataset merges.

Would System.Transactions help here? Would that roll back both the sql
commands and the dataset merges? The help file is still sparse on this new
feature of 2.0.

TIA,

Mike Rodriguez


.



Relevant Pages

  • Re: Opinions needed about the best "Middleware suite" kbmMW vs. RODA
    ... spend hours just first figuring out how does framework works, ... already using Chached Updates. ... I'm making heavy use of identity fields of sql server, ... What about master detail, where the primary field of the master record ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Problems with SQL MSDE after SBS SP1 upgrade!
    ... Thanks for updates. ... This newsgroup only focuses on SBS technical issues. ... | Subject: Re: Problems with SQL MSDE after SBS SP1 upgrade! ...
    (microsoft.public.windows.server.sbs)
  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... Hard code WHERE clauses. ...
    (comp.lang.cobol)
  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... explicitly code dummy words as bind variable placekeepers, put the host variables on the ...
    (comp.lang.cobol)
  • Re: Opinions needed about the best "Middleware suite" kbmMW vs. RODA
    ... Those that answers this question best are "DA03 - Introduction to Schemas" ... > updates" like ado.net, and cascading delete, so if you delete a master ... > default sql, where the it autamaticly creates the sql (for ...
    (borland.public.delphi.thirdpartytools.general)