Passing all records of Child Collection in one call to Stored Proc as XML

Passing all records of Child Collection in one call to Stored Proc as XML

Old forum URL: forums.lhotka.net/forums/t/3470.aspx


Vinodonly posted on Tuesday, September 04, 2007

I have a requirement, where all records of child collection are to be passed as XML to the stored procedure.

My stored procedure is also having some complex checks and once it is verified then it will add those records.

Has anybody done anything like that or is there any example on how collection object is modifed to support this..

Kindly help..

McManus replied on Tuesday, September 04, 2007

Hi,

Rocky referenced the following article in one of his blog posts. Maybe it's of any help...

http://dotnet.sys-con.com/read/406637.htm

Cheers,
Herman

Vinodonly replied on Wednesday, September 05, 2007

Thanks for the help but this is not exactly what i was looking for.

Currently in our BO's, all child collections simply request child object to save itself but in my case, collection will be responsible for sending all child objects together to stored proc.

If checks are passed in stored proc for all records then it will be added.

triplea replied on Wednesday, September 05, 2007

Same technique should still do the trick for you. But you would need to replace the parent (in the example) to be your actual list (so e.g. if you have a Person with an Order list then your XML should have Orders as its parent node and Order as its siblings).
Out of interest, is anyone using the above mentioned technique?

Copyright (c) Marimer LLC