﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Copying Data from one BO to another BO</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 19:41:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Copying Data from one BO to another BO</title><link>http://forum.strataframe.net/FindPost5339.aspx</link><description>I have two BusinessObjects, of different types and databases.&amp;nbsp; I have to copy the data from one row into the other row.&amp;nbsp; I do this manually now by creating a newrow on the target BO, and then passing the current datarow for each to a method that sets the fields on the target BO from the source BO.&amp;nbsp; Then the targetBO has Save called.&lt;/P&gt;&lt;P&gt;This is done on several BO's with parent-child relationships.&amp;nbsp; My main problem are speed issues.&amp;nbsp; When I go to add a Topmost row in the parent-child relation order (? I guess its called an order, I dunno), it must add that single record, then all child records, grandchild records, great-grandchild records, and great-great-grandchild records.&amp;nbsp; These are done all the same way, newrow, copy all the fields, then save.&lt;/P&gt;&lt;P&gt;When all is said and done, I've added approximately 200-400 rows into the database and this is sometimes taking 20-30 seconds.&lt;/P&gt;&lt;P&gt;Is this the proper way to copy data from one BO to another or different types, or is there a better way?&lt;/P&gt;&lt;P&gt;Thanks. And have a good weekend.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Mon, 18 Dec 2006 08:48:59 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Copying Data from one BO to another BO</title><link>http://forum.strataframe.net/FindPost5379.aspx</link><description>Gotcha.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Robin Giltner.</description><pubDate>Mon, 18 Dec 2006 08:48:59 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Copying Data from one BO to another BO</title><link>http://forum.strataframe.net/FindPost5378.aspx</link><description>Yes, the only difference is that the INSERT is done with a stored procedure rather than with the dynamic SQL built by the DataLayer.</description><pubDate>Mon, 18 Dec 2006 08:32:54 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Copying Data from one BO to another BO</title><link>http://forum.strataframe.net/FindPost5377.aspx</link><description>Thanks Ben, thats what I was afraid of.&amp;nbsp; One more quick question, if I create a StoredProcedure to do the Insert, do the BO rules still get checked?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Mon, 18 Dec 2006 08:07:19 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Copying Data from one BO to another BO</title><link>http://forum.strataframe.net/FindPost5348.aspx</link><description>The speed issues are coming from the fact that all of the business objects are checking their business logic each time they save their records... all 200-400 of them.&amp;nbsp; Generally, if you need raw speed, you have to hand code the ADO.NET.&amp;nbsp; So, if you don't need the business rules checking, say the business rules have already been checked because the records already exist in the database, then you can just copy them and use the raw ADO.NET.&amp;nbsp; However, you loose the effectiveness of the business objects if you need the rules checking, and you also have to hand code any database structure changes each time the database itself changes.&amp;nbsp; So, if you need the rules checking, then you will probably have to keep the business objects logic.&lt;/P&gt;&lt;P&gt;You might also look into SQL Server bulk updates... you can execute several inserts all at once with a bulk update.&lt;/P&gt;&lt;P&gt;And if the structures are the same between the business objects (which they probably aren't... since you mentioned different databases), then you'll most likely want to copy the data between the rows by copying the item array within the DataRow.</description><pubDate>Fri, 15 Dec 2006 21:13:45 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>