I'm working with SQL Server 2005 and VB.Net. I only want to store the date
(not the time) in the DateTime field.
I have a text field that is bound to a DateTime field in SQL. When I run the
program, the field initially comes up blank for new records. I enter a date
(like "03/14/06") and save the record.
When I retrieve the record and display it again, the field shows "03/14/06
12:00:00 AM". Now, that's annoying (and I would like to not display the time)
but I could live with it, if I had to.
The problem is, if I leave the entry like that and save the record, I get an
error message about my date field being too long for the field size.
What?!?!?!? I let the database populate the field, I didn't change it, and
now it says it's not good to put back in the database?
How do I save a DateTime field properly into SQL Server 2005? That's the
most important question.
The secondary question is, how do I get a bound field to only show the Date
portion of the database data?