how to get month number from month name in c#

how to get month number from month name in c#:

step-1:
    inclued this name space
using System.Globalization;

step-2:
    use this code
string no= Convert.ToString(DateTime.ParseExact("may", "MMMM", CultureInfo.InvariantCulture).Month)

Here instead of "may" you can give your month name.

Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

A type named 'SP.Data. could not be resolved by the model error

Add content type to SharePoint List/Library using REST API