﻿<?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 » WinForms (How do I?)  » Fixing Errors in Sample</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 13:57:33 GMT</lastBuildDate><ttl>20</ttl><item><title>Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11754.aspx</link><description>This is the error in the CRM Sample App:&lt;P&gt;Error&amp;nbsp;1&amp;nbsp;Value of type '1-dimensional array of Byte' cannot be converted to 'System.Drawing.Image'.&amp;nbsp;C:\Program Files\MicroFour\StrataFrame\VB.NET Samples\CRMApplication\SampleCRMApplication\Forms\OrderItemEntry.vb&amp;nbsp;37&amp;nbsp;33&amp;nbsp;SampleCRMApplication&lt;BR&gt;&lt;/P&gt;&lt;P&gt;This is the line:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.picPhoto.Image = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.ProductsTemp.prod_Image&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;What should I try? TIA.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 02 Oct 2007 09:13:08 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11785.aspx</link><description>Hrm, it could be that the business objects being used by the CRM sample are not correct.&amp;nbsp; The prod_Image field is supposed to be a serialized System.Drawing.Bitmap, not a raw byte[].&amp;nbsp; It's supposed to look like this:&lt;/P&gt;&lt;P&gt;Public Property [prod_Image]() As System.Drawing.Bitmap&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return CType(Me.BinaryFormatter.Deserialize(New MemoryStream(CType(CurrentRow.Item("prod_Image"), Byte()))), System.Drawing.Bitmap)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set(ByVal value As System.Drawing.Bitmap)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loStream As New MemoryStream()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.BinaryFormatter.Serialize(loStream, value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.CurrentRow.Item("prod_Image") = loStream.ToArray()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Set&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;/P&gt;&lt;P&gt;So, paste that code over the prod_Image property and it should build properly.</description><pubDate>Tue, 02 Oct 2007 09:13:08 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11767.aspx</link><description>I just went to the menu VS -&gt; Found the CRM example-&gt; Loaded it -&gt; Did a build on project .&lt;br&gt;</description><pubDate>Sun, 30 Sep 2007 14:21:29 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11765.aspx</link><description>I just ran the sample of a fresh install without issue.&amp;nbsp; How are you producing this error?</description><pubDate>Sat, 29 Sep 2007 11:52:44 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11761.aspx</link><description>There are several of these errors. Do I need to use a different image for each one of them? Also, does it require a special type of image and where will I save them?</description><pubDate>Fri, 28 Sep 2007 15:59:57 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Fixing Errors in Sample</title><link>http://forum.strataframe.net/FindPost11758.aspx</link><description>Well, this is a data issue not an application issue.&amp;nbsp; We noticed, recently in fact, that our distribution image data for the sample data had been overwritten, thus, there is not an image which is ties to the product any longer.&amp;nbsp; You can attach an image to the record then save, or create a new record and attach an image, and it should update properly.&lt;/P&gt;&lt;P&gt;All we are trying to show here is how a BO can serialize an image into a byte array and retrieve from the database without any coding on the side of the developer.</description><pubDate>Fri, 28 Sep 2007 15:06:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>