I have an asp.net application in c#.
i have created one page to insert new candidate.In which i want to store candidate DOB.
When i'm giving DOB: 04/04/1980.
I'm getting this error.
Hide Copy Code
Code
String was not recognized as a valid DateTime.What I have tried:
Hide Copy Code
Code
newCandidate.FirstNameAR = txtFirstNameAR.Text.Trim(); newCandidate.LastNameAR = txtLastNameAR.Text.Trim(); newCandidate.DOB = Convert.ToDateTime(txtDOB.Text);//Error newCandidate.Address = txtAddress.Text; newCandidate.CountryID = Convert.ToInt16(ddlCountry.SelectedValue);i have added one label for testing.. as,
Hide Copy Code
Code
label1.Text = DateTime.Now.ToShortString();and i got, hijri date. But not G-Date. But my system in clock is display G-Date.
i have checked my clock setting and region as well.
How to solve this. Please guys help me.
Thanks

Joginder BangerRank #360 · 7K reputationPosted Aug 15, 2016, 12:39 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 15, 2016, 1:58 AM EDT