I am working on a windows application that will store customer data along with image,
I have done the part of uploading a image. Now I want to write a code that will work as like download link in web applications.
private void btnUpload_Click(object sender, EventArgs e)
{
try
{
string str = ConfigurationManager.ConnectionStrings["MySampleDBConnectionString"].ConnectionString.ToString();
SqlConnection con = new SqlConnection(str);
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg";
if (open.ShowDialog() == DialogResult.OK)
{
txbImg.Text = open.FileName;
pictureBox1.Image = new Bitmap(open.FileName);
}
btnSave.Visible = true;
}
catch (Exception ex)
{
MessageBox.Show("Error" + ex.Message.ToString());
}
How to get it back and save to computer?