Author: iftikharhashmi | Posted on: 8/3/2008 11:54:04 PM | Views : 282

 Hi, My problem is that when i m in development area date formate is accepted in the formate of (dd-MM-yyyy) when i deployed the application explorer erase an error the String was not recognize as valid Date Time what is that i m very confused pleas please help me.........My code is as under take one thing in ur mind i m inputing two dates start date and end Date and make difference b/w them my code is as under please reply fast....    
 
string start = string.Format("{0:d}", this.PeriodFromTextBox22.Text);
string end = string.Format("{0:d}", this.PeriodToTextBox23.Text);
DateTime conStrat =Convert.ToDateTime(start);
DateTime conEnd = Convert.ToDateTime(end);
this.PeriodFromTextBox22.Text = conStrat.ToString("dd-MM-yyyy");
this.PeriodToTextBox23.Text = conEnd.ToString("dd-MM-yyyy");
TimeSpan days = conEnd.Subtract(conStrat);
PeriodDaysTextBox24.Text = Convert.ToString(days ...

Go to the complete details ...