﻿<?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?)  » Images and Null Values</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 13 May 2026 11:35:41 GMT</lastBuildDate><ttl>20</ttl><item><title>Images and Null Values</title><link>http://forum.strataframe.net/FindPost13598.aspx</link><description>I do not know what happened.&amp;nbsp; All was going quite well.&amp;nbsp; The demo Friday was excellent...no errors in the presentation.&amp;nbsp; One of the users suggested that I reimport our part data so that the two systems are synchronized on Monday.&amp;nbsp; No problem.&amp;nbsp; I had the SQL script ready to fire in that event.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Last night I ran the import.&amp;nbsp; No problems.&lt;/P&gt;&lt;P&gt;Today, users are sending me lots of error windows.&amp;nbsp; In my initial investigation, I ran across a problem with the image field in the part table.&amp;nbsp; It was working fine before, but now it won't handle null data.&amp;nbsp; This just doesn't make sense.&amp;nbsp; I ran the DevEx update to the most recent control suite and also reset the Inherited UI project.&amp;nbsp; No problems with that; however, that makes no difference.&amp;nbsp; &lt;/P&gt;&lt;P&gt;What could I have done to mess up my image handling?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR&gt;Bill</description><pubDate>Wed, 23 Jan 2008 09:04:48 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Images and Null Values</title><link>http://forum.strataframe.net/FindPost13666.aspx</link><description>Seems to be that when you had the version working, there were no NULL values in the database for your testing data, but when you merged the two databases, several of the images were missing and were replaced by NULLs.&amp;nbsp; BTW, by default, a StrataFrame business object will insert an empty array for a byte[] field, so any new rows generated through the business objects would not have thrown the error.&amp;nbsp; However, when you set the AllowNullValuesOnNewRow property to true, the NULL value is not replaced, so you could then end up with NULL values in that field.</description><pubDate>Wed, 23 Jan 2008 09:04:48 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Images and Null Values</title><link>http://forum.strataframe.net/FindPost13611.aspx</link><description>No biggie...I will take a pragmatic approach on this one.&amp;nbsp; It is working, so I'll just tip-toe as I walk by any of that code in the future.</description><pubDate>Mon, 21 Jan 2008 17:21:53 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Images and Null Values</title><link>http://forum.strataframe.net/FindPost13605.aspx</link><description>I see how the error manifested itself, but I am not sure what changed between your versions.&amp;nbsp; Your correction is the same thing that I would have done...but without further investigation I am not sure I could give you a straight answer :)</description><pubDate>Mon, 21 Jan 2008 16:54:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Images and Null Values</title><link>http://forum.strataframe.net/FindPost13600.aspx</link><description>I added the following syntax to the replacement value:&lt;/P&gt;&lt;P&gt;new byte[] {}&lt;/P&gt;&lt;P&gt;That works...but I still do not know what went wrong.&lt;/P&gt;&lt;P&gt;:doze:</description><pubDate>Mon, 21 Jan 2008 13:10:46 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Images and Null Values</title><link>http://forum.strataframe.net/FindPost13599.aspx</link><description>The specific error that I am getting is "{"Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'."}".&amp;nbsp; &lt;/P&gt;&lt;P&gt;This is the property code on which&amp;nbsp;the error occurs:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt;[] sketch&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; (System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt;[])&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRow[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"sketch"&lt;/FONT&gt;&lt;FONT size=2&gt;];&amp;nbsp; &amp;lt;---error fires on this line!&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;set&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRow[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"sketch"&lt;/FONT&gt;&lt;FONT size=2&gt;] = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;I thought I would try the old replace value on null trick, but I cannot seem to get the C# syntax right.&amp;nbsp; But, then I keep thinking that I did not have to do that before the import.&amp;nbsp; It was working fine with the code above.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thoughts, anyone?&lt;BR&gt;Bill&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 21 Jan 2008 12:37:16 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item></channel></rss>