清除数据行中的日期字段 [英] Clear out a date field in a data row
问题描述
在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. 如果 ( .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[ 用法" ] = 0;
dRow [ "Usage"] = 0;
dRow[ "EQStatus" ] = "EQStatus"]= "Replacement";
} Hi, 这篇关于清除数据行中的日期字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
for example:
dRow["MTBF"] = 0;
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 列的数据类型是什么?
What error did you receive if set dRow["InstallDate"] to null, DBNull or others? what's the data type of column InstallDate?