1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Uploading image on the server using c# windows application.

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

  1. #1
    Hello
    SEMrush
    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
    SEMrush
  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