﻿<?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.GetEnumerable in web page</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 20 Sep 2026 19:51:48 GMT</lastBuildDate><ttl>20</ttl><item><title>BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20455.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I am trying to use GetEnumerable with a Business Object in a web page like this:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; ( Serv_ClosedBO mBO &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Serv_Closed.GetEnumerable())&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;but when I try to build the web site, I get an error that says: &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;"&amp;nbsp;The type of namespace name 'Serv_CLosedBO' could not be found (are you missing&amp;nbsp; a using directive or an assembly reference?)&amp;nbsp; "&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;The BO is declared in the corresponding applicationbasepage,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&amp;nbsp;Can I use GetEnumerable in web pages? what am I missing?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 30 Oct 2008 15:58:15 GMT</pubDate><dc:creator>Hugo R. Figueroa</dc:creator></item><item><title>RE: BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20468.aspx</link><description>Thank you</description><pubDate>Thu, 30 Oct 2008 15:58:15 GMT</pubDate><dc:creator>Hugo R. Figueroa</dc:creator></item><item><title>RE: BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20467.aspx</link><description>Yep, 'using' the namespace of your BOs would help!  :P&lt;br&gt;
&lt;br&gt;
I didn't read your original post closely enough and thought you had used the type (Serv_ClosedBO) with GetEnumerable(), but in fact you hadn't... oops  :blush:&lt;br&gt;
&lt;br&gt;
Glad you got it going! :D</description><pubDate>Thu, 30 Oct 2008 15:52:06 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20464.aspx</link><description>Well now I am "using" the namespace where the business objects are, and problem solved (at least I can compile).</description><pubDate>Thu, 30 Oct 2008 14:56:53 GMT</pubDate><dc:creator>Hugo R. Figueroa</dc:creator></item><item><title>RE: BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20463.aspx</link><description>I am lost now .&lt;/P&gt;&lt;P&gt;BOs are not supposed to be instantiated in applicationbasepage and so be available in my page?&lt;/P&gt;&lt;P&gt;:crying:</description><pubDate>Thu, 30 Oct 2008 14:39:49 GMT</pubDate><dc:creator>Hugo R. Figueroa</dc:creator></item><item><title>RE: BO.GetEnumerable in web page</title><link>http://forum.strataframe.net/FindPost20457.aspx</link><description>Hugo,&lt;br&gt;
&lt;br&gt;
I think the problem is that GetEnumerable isn't a shared (static) method. It is an instance method. Thus you need to call it on the BO you want to enumerate, not on the BO Type itself.  I.e.&lt;br&gt;
&lt;br&gt;
[codesnippet]// This won't work, calling GetEnumerable on type&lt;br&gt;
foreach ( Serv_ClosedBO mBO in Serv_Closed.GetEnumerable())&lt;br&gt;
&lt;br&gt;
// Use something like this instead&lt;br&gt;
Serv_ClosedBO mainBO = new Serv_ClosedBO();&lt;br&gt;
foreach ( Serv_ClosedBO mBO in mainBO.GetEnumerable())&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Obviously, you would use the approriate BO to enumerate that you've setup in your master page. This is just a sample to demonstrate that you call GetEnumerable on an [i]instance[/i].&lt;br&gt;
&lt;br&gt;
Hope that helps!&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 30 Oct 2008 13:41:23 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>