从Oracle转换为C#中的DateTime的日期 [英] Date from Oracle converting to DateTime in C#

查看:1076
本文介绍了从Oracle转换为C#中的DateTime的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我只是选择
从tableName
中选择FirstName,DOB 显示在网格中
TOAD中的查询给出DOB的结果为1985年12月22日
正确的
但是甚至在绑定到网格之前在数据集中

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

1985/12/22上午12:00:00
22/12/1985 12:00:00 AM



时间本身被串联起来了



that is time itself gets concatenated

<itemtemplate>
                                                   <asp:TextBox ID="txtPDOB" runat="server" Width="94%" Enabled="false" Text='<%# Bind("DOB") %>' />
                                               </itemtemplate>


我只对日期感兴趣,请在Oracle中建议


I am only interested in Date Please suggest

推荐答案

.日期始终包含时间部分.最好是在用户界面中将其格式化为正确的格式.

但是如果需要,您可以将其转换为字符,例如:
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:
SELECT TO_CHAR(MyField, 'dd/mm/yyyy') ...


但是如可能的话,让数据采用日期格式并使用UI格式


But as said if possible, let the data be in date format and use UI formatting


这篇关于从Oracle转换为C#中的DateTime的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆