LINQ saving images to varbinary

Posted by m4rc on Stack Overflow See other posts from Stack Overflow or by m4rc
Published on 2011-06-28T12:12:27Z Indexed on 2011/06/29 8:22 UTC
Read the original article Hit count: 223

I'm having issues saving images to a varbinary(Max) field using LINQ. I can save files in the region of 10KB to the database no problems, but when it comes to files bigger than that, it's as though it doesn't even try.

I've had a look in the SQL Server Profiler and when the file is around 10KB I can see the full insert statement in the detail pane. However, when the file is a bit bigger, the detail pane doesn't show anything, although any data besides the varbinary field is written to the database.

The data is in the Data Object just before SubmitChanges so I can't figure out what's happening between now and then!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET