Uploading image on the server using c# windows application.

Discussion in 'C#' started by seotraining, Dec 8, 2013.

  1. #1
    Hello

    i want to upload image using desktop application and not the web application. I want to upload at particular time interval say half an hour automatically. How can I do that?
     
    seotraining, Dec 8, 2013 IP
  2. anushka123

    anushka123 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #2
    use this code for uploading image on server

    SqlConnection cn = new SqlConnection("data source=(local);initial catalog=testpic;user id=sa;password=123");
    cn.Open();
    SqlCommand cmd = new SqlCommand("insert imgtest values(" + textBox1.Text + ",'" + ImageToBase64(pictureBox1.Image,
    System.Drawing.Imaging.ImageFormat.Png) + "')", cn);
    SqlDataReader dr = cmd.ExecuteReader();
    cn.Close();
     
    anushka123, Oct 27, 2014 IP