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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. DateTimePicker ...binding to datetime field ..can it null?

DateTimePicker ...binding to datetime field ..can it null?

Scheduled Pinned Locked Moved C#
wpfwcfhelptutorialquestion
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.
  • K Offline
    K Offline
    Khanh Duy
    wrote on last edited by
    #1

    :confused:DateTimePicker ...How to take it null when binding it to a datetime field? I have an Customers table (ID,Name,BirthDay(datetime)) and I use DatetimePicker to bind with BirthDay... and when I don't know the birthday of some Customers ,so I want its value is null....Can you help me????thank you so much... The man with nothing to lose

    C N 2 Replies Last reply
    0
    • K Khanh Duy

      :confused:DateTimePicker ...How to take it null when binding it to a datetime field? I have an Customers table (ID,Name,BirthDay(datetime)) and I use DatetimePicker to bind with BirthDay... and when I don't know the birthday of some Customers ,so I want its value is null....Can you help me????thank you so much... The man with nothing to lose

      C Offline
      C Offline
      Corinna John
      wrote on last edited by
      #2

      The default Windows.Forms.DateTimePicker cannot be empty. :( Search the articles for "nullable datetime", all you'll find better DateTimePickers, like this one[^] or that one[^] _________________________________ Please inform me about my English mistakes, I still try to learn your language!

      1 Reply Last reply
      0
      • K Khanh Duy

        :confused:DateTimePicker ...How to take it null when binding it to a datetime field? I have an Customers table (ID,Name,BirthDay(datetime)) and I use DatetimePicker to bind with BirthDay... and when I don't know the birthday of some Customers ,so I want its value is null....Can you help me????thank you so much... The man with nothing to lose

        N Offline
        N Offline
        NassosReyzidis
        wrote on last edited by
        #3

        Hi Khanh, istead of DateTimePicker.Value = null use DateTimePicker.Value = System.DBNull.Value Hope that helps GanDad

        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