How to get default date of birth when we give age?
Hai Guys,
I need to get the default date to the dob(dateTime picker) when i give the age in textbox. can any one help me.....
thanks in advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Aug 2, 2012, 12:58 AM
try...
int age = 20; // set age from textbox like Convert.ToInt32(TEXT1.Text)
DateTime mydate = DateTime.Now;
mydate = mydate.AddYears(-1 * age);
mydate is set to you datetime picker...
it will return 2/08//1992
hope this will help you.
divyaPosted Aug 2, 2012, 1:12 AM
Santhosh Kumar JayaramanPosted Aug 2, 2012, 12:54 AM