Property or indexer 'System.DateTime.TimeOfDay' cannot be assigned to — it
is read only
I saw lots of duplicate post of this But for me it's something different.
I have a Datetime object and get time portion & assign another time to
that.When i'm going to assign it it raise those error.
in here newStartDateGroup is a DateTime Object in here OpenTime is a TimeSpan
Property or indexer cannot be assigned to — it is read only
else if(newStartDateGroup.TimeOfDay < i.OpenTime &&
newEndDateGroup.TimeOfDay > i.CloseTime) // < >
{
newStartDateGroup.TimeOfDay = i.OpenTime;
No comments:
Post a Comment