Similar but different.
The following is from Dino Esposito's excellent book, "Applied XML
Programming for Microsoft .NET"--
"Apart from the patent similarity in their schemas, Updategrams and
DiffGrams have slightly different goals. Updategrams have been designed to
update SQL Server; DiffGrams are mostly a stateful way to persist the
contents of a DataSet object. (ADO.NET DiffGrams are covered in Chapter 10.)
Converting DiffGrams to Updategrams is certainly possible at the schema
level, but Updategrams are unquestionably more powerful objects. Together
with SQLXML 3.0 and the SQL Server XML extensions, Updategrams let you
control concurrency, control the order of updates, perform transactional
updates, and specify parameters.
"On the other hand, there is not yet a .NET Framework class that works like
an Updategram. (And SQLXML 3.0 is still a hybrid, half COM and half managed
code.) Most of the batch update features you find in Updategrams can be
implemented in ADO.NET using the DataSet object's Update method and the
provider-specific data adapter object. Nothing comes for free, though, and
you must write a lot of code to emulate Updategrams in the .NET Framework."
"Eirik M." <eirik_at_stockpoint_dot_no> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
May I ask if an Updategrams is the same as a diffgram or is it a different
beast?
Eirik M
"Jon Sequeira" <DO*****************@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Thanks. That sounds like what I had in mind, and figured someone has to have had the same idea before.
Regards,
Jon
"Christoph Schittko [MVP]" <ch********************@austin.rr.com> wrote
in message news:uh*************@tk2msftngp13.phx.gbl... There is currently nothing like that in SQLXML. I've used the
XmlSerializer before to populate the <before> and <after> sections, but found that
there were a few incompatibilities. The two of them I can remember right now are the handling of null fields/properties, which caused me to handle
these cases individually and problems updating nested Xml that was defined
as an inverse relationship.
I wound up with some sort of "factory pattern" where I would pass the before and after instance of an object to a "factory class" that would
produce an updategram. This pattern would allow me handle incompatibilities where
necessary and also allow for cases where I didn't want/need a fully
populated "before" or "after" object.
This pattern also allows for reordering and grouping <before> and <after> sections to take advantage of database transactions or work around
cases that SQLXML doesn't handle right.
The bottom line was that you probably should create a framework for
the generation of updategrams, but still write custom code to generate
Updategrams.
--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"Jon Sequeira" <DO*****************@yahoo.com> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
> Does anyone know of a component or class that available for
generating > updategrams from custom business objects? Ideally I need something
that > parses a mapping schema, interrogates an object, and produces an
updategram.
>
> Any suggestions are welcome.
>
> Thanks.
>
> Jon
>
>