varbinary(max) to store an image.


Author
Message
Ross L Rooker, Sr.(1)
Ross L Rooker, Sr.(1)
StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)StrataFrame User (148 reputation)
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();
            }
        }


 



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
     YES!!!! Perfect.
Ross L Rooker, Sr.(1) - 10 Years Ago
             Awesome. Glad it's working for you :)
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago
StrataFrame Team - 10 Years Ago
Ross L Rooker, Sr.(1) - 10 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search