﻿<?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?)  » Subset of BO's data</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 04:12:57 GMT</lastBuildDate><ttl>20</ttl><item><title>Subset of BO's data</title><link>http://forum.strataframe.net/FindPost27211.aspx</link><description>I have a table comprising a list of file paths&amp;nbsp;for images and an associated identity. Images for the same item share the same identity.&amp;nbsp;I have loaded the entire data into the BO to save on accesses to the database. My intention is to get a subset of the data using the associated identity, but I'm not sure how to achieve this. Can anyone point me in the right direction.&lt;/P&gt;&lt;P&gt;Many thanks in advance.</description><pubDate>Tue, 25 May 2010 04:56:26 GMT</pubDate><dc:creator>Ian Hammond</dc:creator></item><item><title>RE: Subset of BO's data</title><link>http://forum.strataframe.net/FindPost27229.aspx</link><description>Many thanks for that pointer, it helped a great deal.</description><pubDate>Tue, 25 May 2010 04:56:26 GMT</pubDate><dc:creator>Ian Hammond</dc:creator></item><item><title>RE: Subset of BO's data</title><link>http://forum.strataframe.net/FindPost27214.aspx</link><description>[quote][b]Ian Hammond (05/24/2010)[/b][hr]I thought that the Filter would do the trick but I can't find any info about how to use it and if its the right method for what I'm trying to achieve.[/quote]&lt;br&gt;
&lt;br&gt;
Thanks for explain.&lt;br&gt;
&lt;br&gt;
Yes the BO.Filter will give you what you want, just need to use it carefully because the filter will affect the BO.CurrentView and BO index, so the bo.Count will reflect the records shown in in the CurrentView which may be filtered or not.&lt;br&gt;
&lt;br&gt;
There are plenty of samples on how to use the filter here in the forums and also in the help file.&lt;br&gt;
&lt;br&gt;
Basically you add the filter like: bo.Filter = "MyFieldName=" &amp; FieldValue, then to reset the filter just set it to blank space bo.Filter = ""&lt;br&gt;
&lt;br&gt;
Hope this help.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 24 May 2010 11:50:30 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Subset of BO's data</title><link>http://forum.strataframe.net/FindPost27213.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;Thanks for your response. I realise that I could just stick a method that populated the BO with a subset of the data collection, but I thought that this would have to make a connection to the database each time I changed&amp;nbsp; item in the main&amp;nbsp;table. &amp;nbsp;Hence, I thought I should populate the BO with the references and then get a subset from this each time I stepped through the main table. I thought that the Filter would do the trick but I can't find any info about how to use it and if its the right method for what I'm trying to achieve.&lt;/P&gt;&lt;P&gt;Regards</description><pubDate>Mon, 24 May 2010 11:26:43 GMT</pubDate><dc:creator>Ian Hammond</dc:creator></item><item><title>RE: Subset of BO's data</title><link>http://forum.strataframe.net/FindPost27212.aspx</link><description>Hi Ian,&lt;br&gt;
&lt;br&gt;
I don't quite understand what you want here, so please explain in more details if possible.&lt;br&gt;
&lt;br&gt;
If you need to get a subset of data, simply create a method in the BO with the desired SQL SELECT to get the subset of data you want to have in the BO, then call this method whenever you need it to fill the BO with that data.  If this is what you are looking for, here is a sample code:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
  Public Sub FillByAllTenantAptNumber(ByVal pCity as String)&lt;br&gt;
        Using cmd As New SqlCommand()&lt;br&gt;
            cmd.CommandText = String.Format("SELECT DISTINCT Apt_No From {0} WHERE City = @City ORDER BY Apt_No", Me.TableNameAndSchema)&lt;br&gt;
            cmd.Parameters.AddWithValue("@City", pCity ).SqlDbType = SqlDbType.VarChar&lt;br&gt;
&lt;br&gt;
            Me.FillDataTable(cmd)&lt;br&gt;
        End Using&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]</description><pubDate>Mon, 24 May 2010 11:09:35 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>