﻿<?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?)  » Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</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:38:48 GMT</lastBuildDate><ttl>20</ttl><item><title>Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</title><link>http://forum.strataframe.net/FindPost12053.aspx</link><description>Hi, I am reading an image field from the database into a property of type[]. When the field is null, I get an &lt;EM&gt;Unable to cast object of type 'System.DBNull' to type 'System.Byte[]&amp;nbsp; &lt;/EM&gt;error. I have changed the StrataFrame generated code for the BO to fix it, but is there some setting that I need to make when generating the BO so this is automatically handled correctly in the generated BO? :D</description><pubDate>Thu, 18 Oct 2007 18:06:22 GMT</pubDate><dc:creator>MarcoR</dc:creator></item><item><title>RE: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</title><link>http://forum.strataframe.net/FindPost12076.aspx</link><description>Hi Guys,&lt;/P&gt;&lt;P&gt;FYI we use "return alternate on null&amp;nbsp;&amp;gt; Nothing" for TimeStamp columns and that works fine to.&lt;/P&gt;&lt;P&gt;I say this because I'm pretty sure the we get a "System.DBNull' to type System.Byte[]" error if we don't get the Timestamp setting correct in the BO Mapper.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Thu, 18 Oct 2007 18:06:22 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</title><link>http://forum.strataframe.net/FindPost12071.aspx</link><description>Cool!</description><pubDate>Thu, 18 Oct 2007 15:10:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</title><link>http://forum.strataframe.net/FindPost12069.aspx</link><description>Thanks! I used new byte[] {} in the alternate and that worked.</description><pubDate>Thu, 18 Oct 2007 14:19:39 GMT</pubDate><dc:creator>MarcoR</dc:creator></item><item><title>RE: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]</title><link>http://forum.strataframe.net/FindPost12065.aspx</link><description>I'm not sure if one of the "return alternate on null" settings would work in this situation, but you could just put your custom code in the custom code area of the BO Mapper (the big text box at the bottom of the field customization form). That way every time your BO is rebuild within the mapper, this code gets used.</description><pubDate>Thu, 18 Oct 2007 12:22:30 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>