Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I am just simply selecting
Select FirstName,DOB from tableName
to be shown in grid
query in TOAD gives result for DOB as 22/12/1985
which is correct
but in dataset even before binding to grid
22/12/1985 12:00:00 AM


that is time itself gets concatenated
XML
<itemtemplate>
                                                   <asp:TextBox ID="txtPDOB" runat="server" Width="94%" Enabled="false" Text='<%# Bind("DOB") %>' />
                                               </itemtemplate>

I am only interested in Date Please suggest
Posted
Updated 1-Dec-11 19:37pm
v2
Comments
[no name] 2-Dec-11 1:37am    
EDIT: added "pre" tag

1 solution

In Oracle Date always contains time portion. The best is to format it in the user interface to proper format.

But if you have to, you can convert it to character, something like:
SQL
SELECT TO_CHAR(MyField, 'dd/mm/yyyy') ...

But as said if possible, let the data be in date format and use UI formatting
 
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