-2
Hello, I have a windows form application, I already have a button to upload via Filedialog to my picture box, displaying it. Follows the code
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "JPG Files(*.jpg)|*.jpg|PNG Files(*.png)|*.png|AllFiles(*.*)|*.*";
if(dialog.ShowDialog() == DialogResult.OK)
{
string foto = dialog.FileName.ToString();
pictureBox1.ImageLocation = foto;
}
}
My question is the following, how I can save in my sql database this image that is in this picture box, using another button, because I have 4 VARBINARY columns, and I want to upload each one at a time and then save everything in a " register " only. Follow the form image to understand my idea.
someone would help me ?
My need in this application is : save the images and then recover them in the database in some format ( both jpeg and png ).
– Gabriel Marques
Updated response with example
– Sérgio Sereno