Reading and Writing files to mssql

Posts   
 
    
gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 08-Mar-2005 21:59:24   

Hi Folks,

I would like to write some images to records in the database. I can't find any samples here, so that's why I post the question.

I would like to know how to read and write (image) files to the database and which fieldtype to use.

Thanks in advance,

Greets, Gab****

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Mar-2005 10:00:31   

gabrielk wrote:

Hi Folks,

I would like to write some images to records in the database. I can't find any samples here, so that's why I post the question.

I would like to know how to read and write (image) files to the database and which fieldtype to use.

Thanks in advance, Greets, Gab****

You should use fieldtype 'Image' in SqlServer. You read the image in .NET into a byte array, and then simply set entity.ImageField = theByteArray; and save the entity and it's in the database simple_smile

Frans Bouma | Lead developer LLBLGen Pro