Reputation: 1043
According to this tutorial , he have 'image' data type to store file bytes. Then, on download action, he just get that image data type value as byte[]
, but I have problem in my solution.
I'm using SQL 2008, LinqToSQL.
Row screenshot
C# screenshot
Error message
P.S This is my first time to work with 'save files to db'.
Upvotes: 0
Views: 5053
Reputation: 887453
As the error clearly states, AttchDB
is a Binary
, not a byte
.
You can call .ToArray()
to get the raw byte[]
data.
Upvotes: 5