Hi.
I'm trying to strip the date part from a DateTime object and store it with a generical date (1900/1/1) in the database field 'day_start' (datetime). I've used the ORM designer in VS 2008 to make the linq to sql bindings and it has generated the default: Dataclasses.designer.cs c# code for me. There I create a new partial method which fires whenever day_start changes, but it seems that changes to the method parameter 'value' don't get save in the following set method of the Property 'day_start'.
Essentialy I have the following method in the Dataclasses.designer.cs:
partial void Onday_startChanging(DateTime? value)
{
if (!value.HasValue)
return;
DateTime newval = new DateTime(1900,1,1);
TimeSpan ts = new TimeSpan(value.Value.Hour, value.Value.Minute, 0);
newval.Add(ts);
value = newval;
System.Web.HttpContext.Current.Trace.Write("time: " + value.Value.ToShortDateString() + " " + value.Value.ToShortTimeString());
}
Which gets fired. But value doesn't get saved with its new value (1900/1/1 + whatever hour is contained in the DateTime object).
What am I doing wrong?
Best Regards
Alek