清除数据行中的日期字段 [英] Clear out a date field in a data row

查看:120
本文介绍了清除数据行中的日期字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CLR代码中,我从数据集中检索数据行,并在特定条件下需要清除数据字段.
例如:

In my CLR code, I retrieve a data row from a dataset, and under specific conditions, I need to clear out a data field.
for example:

 

如果 ( .GetInt(dRow [ " EQStatCode"

if (globals.GetInt(dRow["EQStatCode"].ToString()) == 5)

{

dRow [

"InstallDate" ] = dRow [ "MTBF"; ] = 0;

dRow [

"InstallDate"] = [ WHAT CAN I PUT HERE TO MAKE IT WORK!!!!]
dRow["MTBF"] = 0;

dRow[

用法" ] = 0;

dRow [

"Usage"] = 0;

dRow[

"EQStatus" ] =

"EQStatus"]= "Replacement";

}

I have tried : null, dbnull, sqldatetime.Null, Tried converting "12/31/1899" to a date, etc, and I am seriously stucik on this 'simple' question.

推荐答案


如果set dRow ["InstallDate" ] 设置为null,DBNull还是其他? InstallDate 列的数据类型是什么?

Hi,
What error did you receive if set dRow["InstallDate"] to null, DBNull or others? what's the data type of column InstallDate?


这篇关于清除数据行中的日期字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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