﻿<?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?)  » Business Object Property</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:14:50 GMT</lastBuildDate><ttl>20</ttl><item><title>Business Object Property</title><link>http://forum.strataframe.net/FindPost10289.aspx</link><description>Hi,&lt;br&gt;
I defined a property as below. I get error from designer complaint that it is unable to serialize the code for this property. Any ideas?&lt;br&gt;
&lt;br&gt;
[codesnippet]public MyLibs.MyBO MyBusinessObject&lt;br&gt;
{&lt;br&gt;
    get {return _myBO;}&lt;br&gt;
    set {_myBO = value;}&lt;br&gt;
}[/codesnippet]&lt;br&gt;
&lt;br&gt;
Any ideas?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Mon, 16 Jul 2007 09:18:33 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: Business Object Property</title><link>http://forum.strataframe.net/FindPost10302.aspx</link><description>Getting an "Invalid object name 'Companies'" exception seems to be coming back as an SqlException... its probably trying to access the database at design-time.&lt;/P&gt;&lt;P&gt;So, you can do one of 2 things... &lt;/P&gt;&lt;P&gt;1) Find where you're accessing the database during the get {} of that property and wrap it in an if(!this.DesignMode) {} block like this:&lt;/P&gt;&lt;P&gt;if (!this.DesignMode) &lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // put your code here....&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;2) If you don't want to be able to set the value in the designer (meaning you don't care about telling your LocationsBO which CompaniesBO to use in the form designer), then add the following attributes to your property:&lt;/P&gt;&lt;P&gt;using System.ComponentModel;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;[Browsable(false)]&lt;BR&gt;[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;/P&gt;&lt;P&gt;Thse will prevent the form designer from evaluating the property and setting it in the .designer.cs file for your form.</description><pubDate>Mon, 16 Jul 2007 09:18:33 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Business Object Property</title><link>http://forum.strataframe.net/FindPost10290.aspx</link><description>Hi,&lt;br&gt;
Attached is the actual error message.</description><pubDate>Sun, 15 Jul 2007 05:37:23 GMT</pubDate><dc:creator>Chan</dc:creator></item></channel></rss>