Q

How do I move images from a picture box to and from a database?

I want to store images in a database. I've found examples for moving images from a file to the database and back. What I want to do, however, is move the image from a picture box to the database and back. How is this done?
You should use the method Picture.Image.Save(Stream, ImageFormat) to get the bytes from the picture. The stream can be a MemoryStream which buffer can be assigned to a SqlParameter and stored in the database, for example.

This was last published in April 2003

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close