DateTime field not accepting time


Author
Message
Wil Cantrell
Wil Cantrell
StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)StrataFrame Beginner (27 reputation)
Group: Forum Members
Posts: 23, Visits: 129
We've created a scheduling application that stores a scheduled begin time and end time in the database. Both are System.DateTime values in .NET and datetime values in the database.

When updating the values, everything gets updated fine until I get to the begin time. If I set the value, the business object loses it's index and updates a different record with the correct date, but a midnight time.

For example, if StartTime is '2/25/2008 8:30 AM' and EndTime is '2/25/2008 2:00 PM' then after this:

if (CurrentScheduleDetailBO.NavigateToPrimaryKey(e.ScheduledEmployee.ScheduleDetailId, e.ScheduledEmployee.ScheduleId))

{
if (CurrentScheduledEmployeeBO.NavigateToPrimaryKey(e.ScheduledEmployee.EmployeeNumber, e.ScheduledEmployee.ScheduleId))
{

CurrentScheduleDetailBO.BeginMoment = startTime;
CurrentScheduleDetailBO.EndTime = endTime ;

// alternately, this does the same thing.
Runtime.
Static.CurrentScheduleDetailBO.CurrentRow["BeginMoment"] = startTime;
Runtime.
Static.CurrentScheduleDetailBO.CurrentRow["EndMoment"] = endTime ;

BeginMoment is '8/25/2008 12:00 AM' and the EndMoment is correct at '8/25/2008 2:00 PM'.

There are no triggers in the underlying datastore, nor are there any business rules that I can tell. EndMoment and every other datetime field I set is doing correctly. It's just the BeginMoment that is causing the problem.

____________________
Programmer/Analyst
Captain D's, LLC

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search