Last post May 06, 2015 01:24 PM by Nikunj Bhanushali
May 05, 2015 03:29 PM|amd1|LINK
I'm trying to create an SQL Server CE database using WebMatrix 3. My column that will hold dates is a datetime data type with the default value of "GetDate()". I set it to not allow nulls, yet whenever I start entering in a new row, "NULL" pops up in the
dates column instead of the date and time. I cannot complete the row because I get the error "The column cannot contain null values."
I have tried "GETDATE()", per this post (http://forums.asp.net/t/1731242.aspx?How+do+I+assign+current+date+as+default+value+in+SQL+Server+Compact+4+)
but it doesn't work.
Please help me figure out what I'm doing wrong! Thank you!
May 06, 2015 02:34 AM|ayanmesut|LINK
I had that problem too in my projects, but when you start adding the information through the code, that problem will not be.
(Meanwhile try to click on the date field, press ESC key and then Enter key.)
May 06, 2015 09:23 AM|amd1|LINK
The pressing the ESC key and then Enter makes it work! Thank you!!!
May 06, 2015 01:24 PM|Nikunj Bhanushali|LINK
If data is begin entered manually by using an editor and if a default value is set, make sure that the proper data entry process is followed. The date column will usually populate it