hi, i am trying to save (using linq) the date and time to an SQL field (datetime data type) using Datetime.Now but the seconds are not coming through. Does anyone know how to rig that up?
Ta.
hi, i am trying to save (using linq) the date and time to an SQL field (datetime data type) using Datetime.Now but the seconds are not coming through. Does anyone know how to rig that up?
Ta.
It works fine for me with DateTime.Now. I only have problems with millisecond precision due to the different way how SQL server stores the date.
What type has the SQL table column for your date? Can it store seconds?
There is no problem with the code provided by Grant. Are you having SQLEXPRESS?
As i was using a smalldatetime data field initally i forgot to update my data access layer (linq) after i changed it to datetime. Updating the linq data context has solved my problem. Thanks all.