Group: StrataFrame Users
Posts: 50,
Visits: 163
|
Getting this error:
An exception of type 'MicroFour.StrataFrame.Business.BusinessLayerException' occurred in MicroFour StrataFrame Business.dll but was not handled in user code. Additional information: An error occurred while refreshing the data from field 'tbvo_Groupi.GI_PICTURE' to property 'Image' on control 'pictureBox1.' Are you missing FieldPropertyDescriptor for a custom property?
pictureBox1 is MicroFour.StrataFrame.UI.Windows.Forms.PictureBox
The GI_PICTURE column in a SQL table has the type: varbinary(max).
The BO tbvo_Groupi column GI_PICTURE has a type of System.Byte[]. The Custom Field Properties NULL Value Option is "Don't Allow Nulls". The box for "Use Custom Code" is checked. Here is the custom code:
[Browsable(false), BusinessFieldDisplayInEditor(), Description("GIpicture"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public System.Drawing.Bitmap GI_PICTURE { get { object loValue; loValue = this.CurrentRow["GI_PICTURE"]; if (loValue == DBNull.Value) { return new System.Drawing.Bitmap(1, 1); } else { try { return (System.Drawing.Bitmap)this.BinaryFormatter.Deserialize(new System.IO.MemoryStream((Byte[])loValue)); } catch { return new System.Drawing.Bitmap(1, 1); } } } set { System.IO.MemoryStream loStream = new System.IO.MemoryStream(); this.BinaryFormatter.Serialize(loStream, value); this.CurrentRow["GI_PICTURE"] = loStream.ToArray(); } }
|