Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DateTimepIcker-Error

DateTimepIcker-Error

Scheduled Pinned Locked Moved C#
helptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Udayaraju
    wrote on last edited by
    #1

    dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays

    private void dtpFromDate_ValueChanged(object sender, eventArgs e)
    {
    double value=Convert.ToDouble(txtNoOfdays.Text);
    dtpToDate.Value=dtpFromDate.Value.AddDays(value);
    }

    Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.

    T K 2 Replies Last reply
    0
    • U Udayaraju

      dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays

      private void dtpFromDate_ValueChanged(object sender, eventArgs e)
      {
      double value=Convert.ToDouble(txtNoOfdays.Text);
      dtpToDate.Value=dtpFromDate.Value.AddDays(value);
      }

      Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.

      T Offline
      T Offline
      tasumisra
      wrote on last edited by
      #2

      Udayaraju wrote:

      dtpToDate=dtpFromDate.AddDays(value);}

      i Hope this will work..:)

      vikas da

      1 Reply Last reply
      0
      • U Udayaraju

        dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays

        private void dtpFromDate_ValueChanged(object sender, eventArgs e)
        {
        double value=Convert.ToDouble(txtNoOfdays.Text);
        dtpToDate.Value=dtpFromDate.Value.AddDays(value);
        }

        Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.

        K Offline
        K Offline
        Kaushal Arora
        wrote on last edited by
        #3

        The problem is in First statement double value=Convert.ToDouble(txtNoOfdays.Text); The Convert.ToDouble() function is not getting the correct input to convert. Like there can be nothing in the text box or there can be a space or any other character which is throwing error that the string is not in correct format. Regards, Kaushal Arora

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups