﻿<?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?)  » BO with two tables?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 15 Apr 2026 16:05:02 GMT</lastBuildDate><ttl>20</ttl><item><title>BO with two tables?</title><link>http://forum.strataframe.net/FindPost15596.aspx</link><description>I am trying to setup a situation that we use a lot and would want to continue using.&lt;/P&gt;&lt;P&gt;Basically, we often bind an Infragistics Ultragrid to a dataset containing 2 or 3 tables. If I bind to a BO then it looks like I am restricted to only one table as the BO itself can only deal with a single table. Is this correct or have I missed something?&lt;/P&gt;&lt;P&gt;Thanks.</description><pubDate>Mon, 21 Apr 2008 10:39:38 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: BO with two tables?</title><link>http://forum.strataframe.net/FindPost15798.aspx</link><description>It will...but like anytime you use a grid, things can get more complicated....especially when using bands.&amp;nbsp; A grid looks for a IBindingList interface implementation to determine how to bind and interact with the data object to which it is being bound.&amp;nbsp; So the BBS is just a class that implements the IBindingList interface and exposes the BusinessObject to which it wraps as a unique object (what the IBindingList expects) for each row.&amp;nbsp; If you are going to get very complicated (as using bands get become) it is sometimes easier to create a class heirarchy that helps you do this.&amp;nbsp; You can use a BBS and create several exposed BBS properties that expose the children records.&amp;nbsp; So you would create a BBS class that represents each BO in question, then the parent business object (yes BO not BBS) create a custom property that exposes the child BBS object....like this:&lt;/P&gt;&lt;P&gt;[codesnippet]Private _Orders As New OrdersBBS()&lt;BR&gt;Public ReadOnly Property Orders() As OrdersBBS&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Me.Count &amp;gt; 0 Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _Orders.BusinessObject.Filter = "or_cs_pk = " &amp;amp; Me.cs_pk.ToString()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _Orders&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;End Property[/codesnippet]&lt;/P&gt;&lt;P&gt;Notice that a filter is applied to the child BO when the Orders property was accessed.&amp;nbsp; This ensures that only the orders that belong to the current record are visible at this point in time.&amp;nbsp; &lt;/P&gt;&lt;P&gt;This should at least get you going in the right direction.</description><pubDate>Mon, 21 Apr 2008 10:39:38 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BO with two tables?</title><link>http://forum.strataframe.net/FindPost15796.aspx</link><description>[quote][b]Trent L. Taylor (04/14/2008)[/b][hr]You can do this but you will want to use a BBS (BusinessBindingSource) and treat it like a report entity.&amp;nbsp; By this I mean that you can create a BBS class that automatically wraps your BO, then you can create a property on the parent that is an instance of the children (or other tables).&amp;nbsp; You can see an example of how to create this here: &lt;A href="http://forum.strataframe.net/FindPost15443.aspx"&gt;http://forum.strataframe.net/FindPost15443.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;[/quote]&lt;/P&gt;&lt;P&gt;Just for clarification, does this technique allow multiple tables to be bound to an UltraGrid in a similar format to the attached screenshot which shows a dataset containing three tables?&lt;/P&gt;&lt;P&gt;If so, will the UltraGrid be able to add new records to any of the tables just as it would if the grid was bound&amp;nbsp;to a three table dataset?&lt;/P&gt;&lt;P&gt;Sorry if this is a stupid question but I don't understand the internal workings of the BBS :)&lt;/P&gt;&lt;P&gt;Thanks</description><pubDate>Mon, 21 Apr 2008 10:23:15 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: BO with two tables?</title><link>http://forum.strataframe.net/FindPost15597.aspx</link><description>You can do this but you will want to use a BBS (BusinessBindingSource) and treat it like a report entity.&amp;nbsp; By this I mean that you can create a BBS class that automatically wraps your BO, then you can create a property on the parent that is an instance of the children (or other tables).&amp;nbsp; You can see an example of how to create this here: &lt;A href="http://forum.strataframe.net/FindPost15443.aspx"&gt;http://forum.strataframe.net/FindPost15443.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Finally, another option would be to create a view and still use a single BO if you are not dealing with children items.&amp;nbsp; If you are dealing with a flat table then just create the query and return all of the desired rows from however many tables that you would like.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Grids get tricky...even when you are just creating a simple class that implements IBindingList, when you get deeper it gets more complicated.&amp;nbsp; This is just the nature of grids, but this is something that we do and other developers do on a daily basis...there are just a number of different approaches that you can take.</description><pubDate>Mon, 14 Apr 2008 13:02:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>