Reputation: 2440
I have been trying to figure out how to add an image to my database table, so when a query comes back with information it also provides an image. I see an image data type in SQL server 2008, but I cannot figure out what to do with byte[]. I was hoping to just link to an image in my project folder: images/item1.png
is this possible?
Thank you
Upvotes: 1
Views: 500
Reputation: 9680
You can save the file in database by converting it to byte[]
. I guess you figured this out.
but I cannot figure out what to do with byte[]
For this please go through this post which explains how to get image from byte array.
Hope this works for you.
Upvotes: 1
Reputation: 857
You can insert the images as byte[], and set the pointing column type to BLOB. Then you can insert and retrieve data from that table.
Upvotes: 1