DateTimePicker and Null Values

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this?
I have tried to send a null string to the dataset but it requires a
value type of DateTime.

Thanks,

- John -
 
You have to have some a value like 1/1/1900 or something & treat it as
null...in your code.. Thats what we have done..

VJ
 
If you're using Visual Studio, open up Server Explorer and navigate to the
table. Right-click on the table and select "Design Table". you will then
see a design view of your table with a column called "Allow nulls". Put a
check in the box for the date column and that should solve your problem...
hopefully.

cashdeskmac
 
Hello all:

Does anyone happen to know the best way to handle null values for
DateTimePickers? We have quite a few columns in our db that will not
necissarily have a date for certain entries. How do you allow for this?
I have tried to send a null string to the dataset but it requires a
value type of DateTime.

Thanks,

- John -

Have a look at this control from Alexander Shirshov:
http://www.omnitalented.com/Blog/PermaLink,guid,9ee757fe-a3e8-46f7-ad04-ef7070934dc8.aspx

It extends the DateTimePcker control with nullabel functionality and it's
open source.
 
Back
Top