0

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

DB Row

C# screenshot

c#

Error message enter image description here

P.S This is my first time to work with 'save files to db'.

1 Answer 1

5

As the error clearly states, AttchDB is a Binary, not a byte.

You can call .ToArray() to get the raw byte[] data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.