public int Age(DateTime dt)
{
DateTime today = DateTime.Today;
int age = today.Year - dt.Year;
if (dt > today.AddYears(-age))
age--;
return age;
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
int age = Age(Convert.ToDateTime(TextBox1.Text));
Response.Write("Age:"+age);
}
}
here i want to display a returned age in label and also store in storedprocedure
i want query and code to display in label
thanks