Akil Vhora
Akil Vhora

Reputation: 319

How to store image data into SQL Server 2005

I have to store System.Drawing.Image ImageObject into the database. I have tried with byte[] like I do ImageObject convert to byte[] and than store to database but while storing the length of converted byte array is greater than max limit of binary data type of SQL.

How I store my data into database?

Upvotes: 2

Views: 353

Answers (1)

Alex Norcliffe
Alex Norcliffe

Reputation: 2479

Change the datatype to varbinary(max). binary has a limit of 8000 bytes. Note: don't use the image datatype, unless you plan on using SQL Server 2005 forever (it is deprecated).

Upvotes: 2

Related Questions