Hello All,
Currntly i am working on a One database application..there is date Format setting for User to change the Date format Withing Application. It is {MM/dd/yyyy} Or (dd/MM/yyyy). Only this two format is allowed through out the application. I am storing every date from applicaiton to database in "MM/dd/yyyy" format. and when retriving i am displying in the format choosen by user in Application.. Ites Works fine on my Pc. but when i installed it in client pc it gives a Errorr stating"String was not recognized as a Valid Datetime".. Does it related to CulterInfo.. ??? Currently My Pc's Currrnt Culture is "English(United States)".
If it related to it How to assign Datefromat and Culture Info.
I am Using the Following code to convert format of date
Convert.ToDateTime(_VardtFromDb).ToString(_VarDateFormat);
here,
_VardtFromDb comes form Database and it is in "MM/dd/yyyy" format
_VarDateFormat is the format specified by User . and it is one of (MM/dd/yyyy) Or {dd/MM/yyyy}
Loading

try abcPosted May 27, 2009, 2:48 AM
Ahmad OthmanPosted Apr 15, 2009, 2:41 PM
try abcPosted Aug 12, 2008, 8:23 AM
Thank you very much
try abcPosted Aug 12, 2008, 1:06 AM
Let me try this...
AlanPosted Aug 11, 2008, 10:18 AM
Try using:
DateTime.ParseExact(_VardtFromDb, "MM/dd/yyyy",null).ToString(_VarDateFormat)