DateTimePicker

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artteam
    New Member
    • Feb 2007
    • 18

    DateTimePicker

    I have a problem with my datetimepicker i.e. it is always taking one value "12/30/1899". I am using following statement to get the values from the datetimepicker and then insert it into datagriedview.

    this.datetimepi cker.text.toStr ing();

    Above statement I am using in my Insert query in order to insert the date into table.

    Could any one help me, and tell me why it is taking same value again and again.

    Thanks in advance
  • Madzone
    New Member
    • Mar 2007
    • 7

    #2
    If you are using ASP.net Then there must be an event called Selection Changed.

    try writing code in that event.

    Comment

    • Teenzonez
      New Member
      • Mar 2007
      • 36

      #3
      Hi,
      If you are using C# then there is an event called ValueChanged.
      I picked the datetime from the datetimepicker and passed the value to a textbox.
      you can simply write:

      txtTextBoxName. Text = dateTimePicker1 .Value.ToString ();

      inside the event.Then in the property window associate the event with the event handler ValueChanged.

      Regards,
      Teenzonez

      Comment

      Working...