StrataFrame Forum

Getting an error when setting an image

http://forum.strataframe.net/Topic2710.aspx

By Ivan George Borges - 9/9/2006

Hi.

I'm trying to set an image field in a table, just as in the CRMSample's ProductMaintenance form. This is the company logo.

Me.Empresas.emp_logo = CType(loImage, System.Drawing.Bitmap)

Did it exactly as in the sample form.BigGrin

Surely, I'm missing something ... would you guys have a clue ?

TIA

By Ivan George Borges - 9/9/2006

Sorry, forgot to post the error.

It's probably the emotion of the moment ...

Value of type 'System.Drawing.Bitmap' cannot be converted to '1-dimensional array of Byte'.

By StrataFrame Team - 9/11/2006

You have to customize the field within the BOMapper and do two things:

1) Set the data type to System.Drawing.Bitmap
2) Check the "Serialized" box.

Most likely, you forgot to check the serialized box Smile

By Ivan George Borges - 9/11/2006

Hi Ben.

Thanks for the reply.

Got rid of that error, and now I have this one:

Type 'System.Drawing.Bitmap' is not defined.

By StrataFrame Team - 9/11/2006

Ah, you will need to add a reference to System.Drawing.dll, which is NOT added by default to a business object library project.
By Ivan George Borges - 9/11/2006

I have a separete BO Library in the solution.

Do I need to need to add a Reference to System.Drawing to it as well ?

By StrataFrame Team - 9/11/2006

You will need to add the reference to the project that contains the business object with the customized field.  Each project's references are independent of the other projects references, so yes, you will have to add one to the bo library as well (it it contains the business object with the customized field).
By Ivan George Borges - 9/11/2006

Working now.

Thanks a lot Ben.

By StrataFrame Team - 9/11/2006

No problem Smile