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.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Dig Deeper on .NET Framework database programming best practices
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ... Continue Reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers. Continue Reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.