Month Problem
-
hello sir I'm trying to format the month name in dropdownlist. I have Month, such as 1,2,3,4,5,6, etc. I want them to display as Jan, Feb, Mar,April etc.ANd i want to show the current month in drop down as sep.help me thanks
prabhakar dwivedi
-
hello sir I'm trying to format the month name in dropdownlist. I have Month, such as 1,2,3,4,5,6, etc. I want them to display as Jan, Feb, Mar,April etc.ANd i want to show the current month in drop down as sep.help me thanks
prabhakar dwivedi
I'm not sure where you're stuck. If you put the names into the list, you can get your number out by adding one to the selected index.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
hello sir I'm trying to format the month name in dropdownlist. I have Month, such as 1,2,3,4,5,6, etc. I want them to display as Jan, Feb, Mar,April etc.ANd i want to show the current month in drop down as sep.help me thanks
prabhakar dwivedi
Hi You can use DateTime.ToString method to achive this... This code will help you out
for(int month=1; month<=12; month++) dd.Items.Add(DateTime.Parse(string.Format("{0}/1/1", month)).ToString("MMM"));
If you need full name of month then use MMMM instead of MMM.
M Aamir Maniar aamirOnline.com