Bechir Bejaoui
posted
1449 posts
since
Dec 06, 2007
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
Is your variable where your searching is type of string?
|
|
|
|
|
Every one among us was a beginner once. http://dotnetuniver.blogspot.com/
|
|
|
|
|
|
John Smith
posted
5 posts
since
Sep 06, 2010
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
Yes and i'll upload the rest of the source code
|
|
|
|
|
|
Bechir Bejaoui
posted
1449 posts
since
Dec 06, 2007
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
Hi
I have a question why in May if section the code is different?
|
|
|
|
|
Every one among us was a beginner once. http://dotnetuniver.blogspot.com/
|
|
|
|
|
|
John Smith
posted
5 posts
since
Sep 06, 2010
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
Because i was trying so many different things, but doesn't seem to make a difference as they don't work.
Since MonthlyCalender doesn't accept month only for some reason from the DateTime, maybe i should try DateTimePicker.
|
|
|
|
|
|
krishna v
posted
16 posts
since
Feb 08, 2006
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
I prefer not going with string in the month. If culture varies, then your code wont work. U better go with Month Property. As you said, u always want to use month, just ignore rest. There is no constructor in DateTime which takes nullable values, which is not meaning ful way.
Otherwise create your own month enum .
|
|
|
|
|
|
Bechir Bejaoui
posted
1449 posts
since
Dec 06, 2007
from
|
|
Re: Using Month Only in DateTime
|
|
|
|
|
|
|
|
|
|
|
Hi
I m agree with you krishna, so John could refactor his code by introducting an enumeration
enum Months{Jun,Feb,Mar,.........}; to avoid hard coding with strings
|
|
|
|
|
Every one among us was a beginner once. http://dotnetuniver.blogspot.com/
|
|
|
|
|
|