i enter date in textbox in format :26/12/2006
i just want get the month n year value:
how to separated it
Printable View
i enter date in textbox in format :26/12/2006
i just want get the month n year value:
how to separated it
You should use a DateTimePicker, not a TextBox. The you can get a Date object from its Value property, then get the Month and Year properties from that.
If you still insist on using a textbox (which is a very bad idea), you can use either Date.Parse or Date.TryParse (which is more prefered) to parse the string in the textbox to a Date object, then the month from its Month property as JMC said.