Answered by:
store image in database

Question
-
how can i store image to MS access database using odbcSunday, September 19, 2010 1:46 PM
Answers
-
Have a look on these links
http://www.dreamincode.net/forums/topic/56022-store-bmp-image-in-access-using-c%23/
Regards Thurupathan My blog : http://thuruinhttp.wordpress.com- Proposed as answer by Thuru VMVP Sunday, September 19, 2010 7:53 PM
- Marked as answer by Alex LiangModerator Monday, September 27, 2010 5:58 AM
Sunday, September 19, 2010 7:52 PM -
Hi,
This article describes on how to create a bye array to image and an image to bye array.
http://www.codeproject.com/KB/recipes/ImageConverter.aspx
In this article byteArrayToImage() returns an Image object.
Once you get the Image object you can directly display it in a pictureBox using the following code
pictureBox1.Image = your image object;
And inserting images in the RichtextBox is little tricky and lengthy. But have a look on this article. You'll get it.
http://www.codeproject.com/KB/edit/MyExtRichTextBox.aspx
My blog : http://thuruinhttp.wordpress.com- Proposed as answer by Thuru VMVP Monday, September 20, 2010 8:57 AM
- Marked as answer by Alex LiangModerator Monday, September 27, 2010 5:58 AM
Monday, September 20, 2010 8:56 AM
All replies
-
Hi, I assume your field in the db is of type byte[] (OleObject or Blob). Then
- save the image to a MemoryStream.
- use the [YourMemoryStreamVariable].ToArray() Method of the MemoryStream to get the byte[].
- write the byte[] to the db-field.
regards,
Thorsten
Sunday, September 19, 2010 4:52 PM -
Have a look on these links
http://www.dreamincode.net/forums/topic/56022-store-bmp-image-in-access-using-c%23/
Regards Thurupathan My blog : http://thuruinhttp.wordpress.com- Proposed as answer by Thuru VMVP Sunday, September 19, 2010 7:53 PM
- Marked as answer by Alex LiangModerator Monday, September 27, 2010 5:58 AM
Sunday, September 19, 2010 7:52 PM -
Have a look on these links
http://www.dreamincode.net/forums/topic/56022-store-bmp-image-in-access-using-c%23/
Regards Thurupathan My blog : http://thuruinhttp.wordpress.comhow to display byte image to pictureBox and richtextbox, what datatype i need to convert so that both (pictureBox and richtextbox) can be display image.
Monday, September 20, 2010 4:44 AM -
Hi,
This article describes on how to create a bye array to image and an image to bye array.
http://www.codeproject.com/KB/recipes/ImageConverter.aspx
In this article byteArrayToImage() returns an Image object.
Once you get the Image object you can directly display it in a pictureBox using the following code
pictureBox1.Image = your image object;
And inserting images in the RichtextBox is little tricky and lengthy. But have a look on this article. You'll get it.
http://www.codeproject.com/KB/edit/MyExtRichTextBox.aspx
My blog : http://thuruinhttp.wordpress.com- Proposed as answer by Thuru VMVP Monday, September 20, 2010 8:57 AM
- Marked as answer by Alex LiangModerator Monday, September 27, 2010 5:58 AM
Monday, September 20, 2010 8:56 AM