﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » Updates and Information » StrataFrame Users Contributed Samples  » How to use a BO to generically retrieve data</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 05 Apr 2026 15:27:37 GMT</lastBuildDate><ttl>20</ttl><item><title>How to use a BO to generically retrieve data</title><link>http://forum.strataframe.net/FindPost26800.aspx</link><description>This sample shows how to retrieve any arbitrary data (i.e. could be completely unrelated to the BO being used) using a BusinessObject.&lt;br&gt;
&lt;br&gt;
The FillDataTable method of the base BusinessLayer class can execute any arbitrary SQL (or a SqlCommand object) and the BO will be loaded with the retrieved data, into a ADO.NET DataTable, referenced via the CurrentDataTable property of the BO.  When answering a question on the forum ([url]http://forum.strataframe.net/FindPost26703.aspx[/url]) I incorrectly thought that using a generic BusinessLayer object would do the trick. Unfortunately, the BusinessLayer is not ready for use, as it requires server properties to be overloaded. This sample shows how to use any mapped BO (thus all the properties are overridden) to get any data needed from the any table required.&lt;br&gt;
&lt;br&gt;
This method can be used with EnterpriseServer. For applications that use direct connections to a database, they normal ADO.NET methods can be used when necessary. However, when using ES, this type of strategy will not work. This can be used when needed to get the job done.&lt;br&gt;
&lt;br&gt;
The sample will prompt you to connect to a database via the normal SF connection wizard.  The sample SQL provided uses the StrataFrameSample database and is designed to query the Customers table. Clicking on the Set Enterprise Connection button will allow you to connect to an ES server to test how it works against an ES server. The GenericBO is mapped to the Customers table form the StrataFrameSample database. However, you can use it to query completely different databases. &lt;br&gt;
&lt;br&gt;
This also shows how to setup a listview to display the results, including setting the populations settings and configuring the columns based on the current data table in the BO.&lt;br&gt;
&lt;br&gt;
Comments are always welcome. Enjoy! :D</description><pubDate>Mon, 12 Apr 2010 09:24:48 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to use a BO to generically retrieve data</title><link>http://forum.strataframe.net/FindPost26815.aspx</link><description>Thanks for the sample, Greg!  Good job. ;)</description><pubDate>Mon, 12 Apr 2010 09:24:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to use a BO to generically retrieve data</title><link>http://forum.strataframe.net/FindPost26804.aspx</link><description>Luiz,&lt;br&gt;
&lt;br&gt;
I'm using a newer version of the Framework. This works on older versions too, you'll just need to make sure the references to the SF assemblies are correct (remove and re-add them) and you'll need to use the BO mapper to redo the GenericBO. Just open the BO Mapper, configure the project to use the StrataFrameSample db and point the GenericBO at the Customers table (actually, any database and any table will work), then rebuild it. Version 1.7 changed how the field descriptors worked (I think that was when it was), so all BOs had to be rebuilt via the BO Mapper. I'm using one or two version from latest, but it is 1.7 something. :D&lt;br&gt;
&lt;br&gt;
Charles,&lt;br&gt;
&lt;br&gt;
Glad you like it!  :cool:</description><pubDate>Fri, 09 Apr 2010 20:56:05 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to use a BO to generically retrieve data</title><link>http://forum.strataframe.net/FindPost26803.aspx</link><description>By George,McGuffey, you've done it again ! :D&lt;br&gt;
&lt;br&gt;
The implications of this technique are ... wow! &lt;br&gt;
&lt;br&gt;
Mind already rushing with how I'll use some of this in reproducing some of the highly developed querying stuff in the the fund-raising app.  &lt;br&gt;
&lt;br&gt;
Thanks for putting together this extremely clear and useful sample.&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 09 Apr 2010 18:17:18 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to use a BO to generically retrieve data</title><link>http://forum.strataframe.net/FindPost26802.aspx</link><description>Greg,&lt;BR&gt;&lt;BR&gt;I´ve got some errors when compiled the project, I have version 1.6.6.0&lt;/P&gt;&lt;P&gt;See the screen-shot.&lt;/P&gt;&lt;P&gt;[quote]&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;6&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;632&amp;nbsp;46&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;7&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;633&amp;nbsp;45&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;8&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;634&amp;nbsp;48&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;9&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;635&amp;nbsp;49&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;10&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;636&amp;nbsp;47&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;11&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;637&amp;nbsp;45&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;12&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;638&amp;nbsp;47&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;13&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;639&amp;nbsp;47&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;14&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;640&amp;nbsp;43&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;15&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;641&amp;nbsp;44&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;16&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;642&amp;nbsp;45&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;17&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;643&amp;nbsp;46&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;18&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;644&amp;nbsp;44&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;19&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;645&amp;nbsp;47&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;20&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;646&amp;nbsp;51&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;21&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;647&amp;nbsp;49&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;22&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;648&amp;nbsp;53&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;23&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;649&amp;nbsp;46&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;24&amp;nbsp;Value of type 'GenericBOSample.GenericBO.FieldDescriptor' cannot be converted to 'MicroFour.StrataFrame.Business.FieldPropertyDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;650&amp;nbsp;46&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;25&amp;nbsp;'MicroFour.StrataFrame.Business.FieldPropertyDescriptor' has no type parameters and so cannot have type arguments.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;787&amp;nbsp;72&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;26&amp;nbsp;function 'GetValue' cannot be declared 'Overrides' because it does not override a function in a base class.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;792&amp;nbsp;31&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;27&amp;nbsp;'Field' is not a member of 'GenericBOSample.GenericBO.FieldDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;793&amp;nbsp;19&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;28&amp;nbsp;sub 'SetValue' cannot be declared 'Overrides' because it does not override a sub in a base class.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;838&amp;nbsp;26&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;29&amp;nbsp;'Field' is not a member of 'GenericBOSample.GenericBO.FieldDescriptor'.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;839&amp;nbsp;19&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;30&amp;nbsp;property 'ComponentType' cannot be declared 'Overrides' because it does not override a property in a base class.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\GenericBO.Designer.vb&amp;nbsp;884&amp;nbsp;40&amp;nbsp;GenericBOSample&lt;BR&gt;Error&amp;nbsp;31&amp;nbsp;Type 'Enterprise.EnterpriseDataSourceItem' is not defined.&amp;nbsp;C:\Users\Luiz\Desktop\GenericBOSample\MainForm.vb&amp;nbsp;169&amp;nbsp;37&amp;nbsp;GenericBOSample&lt;BR&gt;&lt;/P&gt;&lt;P&gt;[/quote]</description><pubDate>Fri, 09 Apr 2010 16:46:26 GMT</pubDate><dc:creator>Luiz Lima</dc:creator></item></channel></rss>