Code which will accept the date in dd/mm/yyyy format and return in the mm/dd/yyyy format in C#

string strFormatted = "";
DateTimeFormatInfo dateTimeFormatterProvider = DateTimeFormatInfo.CurrentInfo.Clone() as DateTimeFormatInfo;
dateTimeFormatterProvider.ShortDatePattern = "dd/MM/yyyy"; //source date format
DateTime dateTime = DateTime.Parse(strDate, dateTimeFormatterProvider);
strFormatted = dateTime.ToString("MM/dd/yyyy");
return strFormatted;

Monday, June 28, 2010

Command to create the Configuration Database and Admin Content Database while installing MOSS 2007

Go to 


C:\\Program Files\Common Files\microsoft shared\web server extensions\12\bin


and use the following command.


psconfig -cmd create -servername sqlserver -database SharePoint_Config
-dbuser sa -dbpass sapassword -user sqlservices -password
sqlservicespassword -admincontentdatabase Admin_Content