Wednesday, July 7, 2010

function to get Month name in C#

I'm reproducing just part of the code:
 
string sDate = iMonth.ToString() + "/01/" + iYear.ToString();

DateTime dtDate = Convert.ToDateTime(sDate);

lblMonth.Text = dtDate.ToString("MMMM");

It's not difficult, right? But I took some time to find the answer in a forum...