﻿<?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?)  » BOM and SQL2005 Computed Columns</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 00:57:39 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost11932.aspx</link><description>Just double-click BO in the Solution Explorer to bring up the BO in the component designer, then go to the property sheet and you will find these properties.&lt;/P&gt;&lt;P&gt;These are just properties on the BO, so you could set this in code also if you had the need.&amp;nbsp;</description><pubDate>Wed, 10 Oct 2007 13:24:24 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost9527.aspx</link><description>Hi!&lt;P&gt;I am having a problem while saving&amp;nbsp;a BO that I created using the SF BOM (Business Object Mapper) which is based on&amp;nbsp;a SQL2005 table that has a computed column in it.&lt;/P&gt;&lt;P&gt;I made that BO column/property ReadOnly in the BOM but if I make changes to any other column and then try to save that BO I get an error that I cannot update&amp;nbsp;a computed column. This is not a calculated/computed column defined&amp;nbsp;at the BO level it is defined as a computed column at the SQL table level. Which brings up two questions:&lt;/P&gt;&lt;P&gt;1] How do I handle SQL2005 computed columns defined at the table level in a BO.&lt;/P&gt;&lt;P&gt;2] How do I selectively pick columns from a table for a BO.&lt;/P&gt;&lt;P&gt;e.g. I have a few text columns with lots of data in them and so&amp;nbsp;I don't want them to be a part of the BO.&lt;/P&gt;&lt;P&gt;It seems that right now the BOM only allows me to pick a table and not specific columns from within that table.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sarosh</description><pubDate>Wed, 10 Oct 2007 13:24:24 GMT</pubDate><dc:creator>Sarosh</dc:creator></item><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost11931.aspx</link><description>exactly how is this specied in the BO:&lt;/P&gt;&lt;P&gt;FieldsToExcludeFromUpdate&lt;BR&gt;FieldsToExcludeFromInsert&lt;/P&gt;&lt;P&gt;I have computed columns and have looked everywhere for these properties and cannot find them.</description><pubDate>Wed, 10 Oct 2007 11:27:53 GMT</pubDate><dc:creator>Ross L. Rooker, Sr.</dc:creator></item><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost9543.aspx</link><description>Hi!&lt;/P&gt;&lt;P&gt;Ben:&lt;/P&gt;&lt;P&gt;Will it be possible to&amp;nbsp;add "ExcludeFromInsert" and "ExcludeFromUpdate" after the ReadOnly column in the BOM which in turn would fill the FieldsToExcludeFromUpdate and FieldsToExcludeFromInsert internally?&lt;/P&gt;&lt;P&gt;What about&amp;nbsp;adding&amp;nbsp;"IncludeInSelect" as well&amp;nbsp;to handle&amp;nbsp;the Selectively picking columns?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sarosh</description><pubDate>Wed, 13 Jun 2007 10:27:33 GMT</pubDate><dc:creator>Sarosh</dc:creator></item><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost9532.aspx</link><description>Greg is correct on the FieldsToExclude* properties.&lt;/P&gt;&lt;P&gt;As for your questions about the null value options, those are set on a per-field level within the BOMapper.&amp;nbsp; You select the field you want to customize, and within the customization option, you use the null value options in the upper right of the customization dialog to set the options.&amp;nbsp; Most data returned from the database is placed into .NET value types, which cannot have null values, so the BOMapper is forced to do some translations between those DBNull.Value values that get returned and the actual value that can be cast as a System.Int32 for example.&amp;nbsp; Also, if you ever need to set a null value explicitly, and you don't have the null value options set on your BO field, you can do so using BO.CurrentRow("FieldName") = DBNull.Value.&lt;/P&gt;&lt;P&gt;If you want to set the null value options on more than one field at a time, you can use the customization wizard within the BOMapper.</description><pubDate>Wed, 13 Jun 2007 08:38:33 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost9531.aspx</link><description>Hi!&lt;P&gt;Yes this help a lot, thanks!&lt;/P&gt;&lt;P&gt;Based on what you&amp;nbsp;have&amp;nbsp;mentioned I will be able to take care of both my issues but I still think that letting you selectively pick columns in the BOM will be cleaner or maybe adding two extra columns in the BOM when we select a BO.&lt;/P&gt;&lt;P&gt;By adding "ExcludeFromInsert" and "ExcludeFromUpdate" (after the ReadOnly column in the BOM) which we could set as "yes" or "no" will handle my issue 1] of Excluding fields in a cleaner way (which in turn could fill the FieldsToExcludeFromUpdate and FieldsToExcludeFromInsert automatically for us)&lt;/P&gt;&lt;P&gt;and maybe even adding a third column "IncludeInSelect" or something like that which will handle my issue 2] of Selectively picking columns.&lt;/P&gt;&lt;P&gt;One more question how do you handle NULLS in the BOM? We have many columns in our tables that allow nulls, shouldn't the BOM just have a "Allow NULLS" as a NullType and set the appropriate value internally?&lt;/P&gt;&lt;P&gt;Sarosh</description><pubDate>Wed, 13 Jun 2007 07:51:59 GMT</pubDate><dc:creator>Sarosh</dc:creator></item><item><title>RE: BOM and SQL2005 Computed Columns</title><link>http://forum.strataframe.net/FindPost9530.aspx</link><description>Sarosh,&lt;br&gt;
&lt;br&gt;
Based on what I've learned/done, I can offer the following insights:&lt;br&gt;
&lt;br&gt;
1. Excluding fields&lt;br&gt;
There are two properties that you can set for a BO (at the BO level, not when dropped on a form):&lt;br&gt;
&lt;br&gt;
FieldsToExcludeFromUpdate&lt;br&gt;
FieldsToExcludeFromInsert&lt;br&gt;
&lt;br&gt;
I believe you enter the names of the fields, one per line, to exclude from inserts/updates.  You'd enter your calculated columns here.  I'm pretty sure this works if you are using sprocs as well.&lt;br&gt;
&lt;br&gt;
2. Selectively picking columns&lt;br&gt;
You can't selectively pick columns in the mapper. It will map all of the fields and create strongly typed properties for them.  However, there is no rule that you have to actually [i]fill[/i] all of those columns. That is completely under your control when you fill the BO with data.  I.e. lets say you have a table with three columns: id, name, comment. Comment is a varchar(max) field and can be quite huge.  You don't have to fill it. I.e. you could have a fill method something like:&lt;br&gt;
&lt;br&gt;
[codesnippet]Public Sub FillIdNameOnly()&lt;br&gt;
  Using cmd As New SqlCommand()&lt;br&gt;
    cmd.CommandText = "Select id, name From yourTable"&lt;br&gt;
    Me.FillDataTable(cmd)&lt;br&gt;
  End Using&lt;br&gt;
End Sub[/codesnippet]&lt;br&gt;
&lt;br&gt;
After calling this command, the ID and name property will work as expected, but the comment property will likely throw an exception, as there will be no column in the datatable.  But that's OK, since you'd only call this if you didn't want the comment anyway.&lt;br&gt;
&lt;br&gt;
Hope this helps!</description><pubDate>Tue, 12 Jun 2007 23:10:41 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>