C#
SqlConnection con = new SqlConnection(this.con);
SqlCommand cmd = new SqlCommand("Select DATEDIFF(YEAR,CONVERT(datetime,'"+ txtDob.Text +"',103),CONVERT(datetime,V_ISSUEDATE,103)) FROM MASTER_NEW", con);
SqlDataReader reader = cmd.ExecuteReader();how to calculate age using DOB.
When user enter DOB in format dd/MM/yyyy in textbox1 than the age should be display in textbox2 using code behind.
i have tryed to do this with using sql query to take server date as current date.
but what to do next no getting idea...



Rijwan AnsariRank #82 · 24.2K reputationPosted Jul 6, 2021, 7:03 AM EDT
Farhan AhmedRank #73 · 25K reputationPosted Jul 6, 2021, 7:01 AM EDT
Md SarfarajRank #194 · 12.4K reputationPosted Jul 6, 2021, 7:02 AM EDT
Bhavesh VankarRank #1,147 · 1.6K reputationPosted Jul 6, 2021, 7:35 AM EDT
Arnab MukherjeeRank #879 · 2.5K reputationPosted Jul 6, 2021, 8:14 AM EDT
Arnab MukherjeeRank #879 · 2.5K reputationPosted Jul 6, 2021, 10:29 AM EDT