Storing Image

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 22-May-2013 15:56:46   

LLBLGEN 4.0 Rel May 15th, 2013 .Net Framework 4.0 C# Windows Application SQL Server 2008 LLBLGEN runtime framework self servicing

I am trying to store image in sql server.

memberimage.Image = Picture;

Column Image in DB is type Image I am passing Image "Picture" as data type Image. Error: Cannot convert source type System.drawing.image to target type byte[].

Also tried memberimage.Image = Convert.ToByte(Picture); Error: Cannot convert source type byte to target type byte[].

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-May-2013 18:03:10   

Did you consider using a TypeConverter as on the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=20806

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 22-May-2013 18:33:34   

Walaa wrote:

Did you consider using a TypeConverter as on the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=20806

I do not see image in type converter for .net type how actually to go about ? I am unable to clearly understand seeing the article above

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-May-2013 19:22:07   

First you need to create your TypeConverter class, build a dll, and place it in the TypeConverters folder in the LLBLGen installation folder. Then you start the designer, to be able to use this TypeConverter in converting dataTypes.

Start by reading: implementing a type converter

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 22-May-2013 19:27:36   

Walaa wrote:

First you need to create your TypeConverter class, build a dll, and place it in the TypeConverters folder in the LLBLGen installation folder. Then you start the designer, to be able to use this TypeConverter in converting dataTypes.

Start by reading: implementing a type converter

Will check and revert. Thread may be closed for now.