Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends when i run my application first time i have error occur 'System.FormatException: String was not recognized as a valid DateTime"'
after that i ran second time there is no error
the problem occur every 1st time. plz help
Posted
Updated 8-Apr-12 21:35pm
v3
Comments
tulasiram3975 9-Apr-12 2:09am    
That means first time it wont have valid date string after that it may have valid date string..
can you show your code so that we can give you proper solution..
kishore sharma 9-Apr-12 2:30am    
can you make it clear is it web application or desktop
so if its web and you mean to run application 2nd time(may be you are doing somthing with Page.IsPostBack).
some more information needed.
OriginalGriff 9-Apr-12 2:41am    
Without the relevant code fragment - at the very least the line that shows the error plus a few lines each side fro context, maybe the whole method - we cannot help you.
Use the "Improve question" widget to edit your question and provide better information.
Mohamed Mitwalli 9-Apr-12 2:51am    
Well you can make break line and debug your code and if you couldn't share your code

1 solution

Looks like you have not initialized your date string variable. Add a valid initialization, and the error may disappear.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900