How to retieve only the date not date and time
I have a form with a Calendar Control and a textbox. Where you can select a hire date from the calendar and show it in the textbox and save it in the database as hireDate.This is one part of the form. The second part of the form is , Once the first part of the form is submitted, it opens up another form with all the information in a texbox control .
So to retrieve the HireDate from the database and show it in the textbox control for the hire date field ,
My code is as below
dtremployee = sqlCommand1.ExecuteReader();
if (dtremployee.Read())
{
txthire.Text =String.Format("{0:c}",(string)dtremployee["HireDate"].ToString());
}
But when the date is retrieved it is showing both the date and time-
"7/27/2006 12:00:00 AM"
Can you tell me how to show only the date not the time.
|