对网格视图的绑定日期有疑问 [英] Doubt in binding date to grid view

查看:70
本文介绍了对网格视图的绑定日期有疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如果该特定字段为空,我将Date作为1/1/1900插入Oracle数据库中,因为Oracle不接受该日期的空值.但是在将其检索到网格视图时,我想显示日期为1900年1月1日为空或"
您能否建议我将其归档的方法.



adv

Hi,


I am inserting Date as 1/1/1900 into Oracle database if that specific field is empty, as Oracle doesn''t accept null values for the date.But while retrieving the same to grid view i want to show the field with date as 1/1/1900 as empty or ""
Could you please suggest me the way to archive this.



Thx in adv

推荐答案

中的Thx您也可以在查询中替换它.
You can replace this in your query also .

SELECT CASE DateValue WHEN '1/1/1900' THEN '' ELSE DateValue END 
FROM table Where Condition =Conditiaonvalue


如果这是Windows Forms应用程序,并且是DataGridView,则处理
If this is a Windows Forms app and it is a DataGridView then handle the CellFormatting[^] event. Replace any occurrences of 1/1/1900 with an empty string.


这篇关于对网格视图的绑定日期有疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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