Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get the date as datatype(date).

When i show that into the webpage, it comes with datetime format.

But i want to remove the time from the date.

so help me plz.


Label1.Text = ds.Tables("table_name").Rows(0).Item("dob").ToString

Label2.Text = ds.Tables("table_name").Rows(0).Item("doj").ToString

Label3.Text = ds.Tables("table_name").Rows(0).Item("dor").ToString



thanks in advance...
Posted

Try
YourDateField.ToShortDateString()
 
Share this answer
 
v2
Try this

C#
Label1.Text = ds.Tables("table_name").Rows(0).Item("dob").ToString("dd/MM/yyyy");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900