I have a database table with a column Birthdate. I want to display the date from the db table to a 'date' textfield on my webform.
For example, the data in my database table Birthdate column is 'Sep 18, 2000' and I want to display it on the 'date' textfield with a format of dd/mm/yyyy.
This is what I have did but it does not display anything on the 'date' textfield
Code in Webform1.aspx.cs
string date = DataAccess.BrgyCitizenBirthdate;
DateTime getBDate = Convert.ToDateTime(DateTime.ParseExact(date, "MMM dd, yyyy", null));
BCBirthdate = getBDate.ToString("dd/mm/yyyy");
Note that the value of DataAccess.BrgyCitizenBirthdate; is Sep 18, 2000.
Code in Webform2.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
txtBirthdate.Text = Brgy_Citizens.BCBirthdate;
}
My output
My DESIRED output

