DateTime d1=DateTime.Now ;
DateTime d2 = new DateTime(1978,4,5);
TimeSpan difference = d1.Subtract(d2);
difference.TotalDays/365.25).ToString();
or
int age= Age(DateTime.Parse("4/26/1973"));
public static int Age(DateTime birthDate)
{
int years, months, days;
DateDiff(DateTime.Now, birthDate, out years, out months, out days);
return years;
}
Happy Coding!
:)