Clear out a date field in a data row RRS feed

  • Question

  • 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:


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



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


    "Usage"] = 0;


    "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.

    Tuesday, March 9, 2010 1:02 AM

All replies

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

    Tuesday, March 9, 2010 2:26 AM
  • My sillyness.

    I had to set the value to dbnull.value, not dbnull.

    To much learning to do.  soryy.

    • Proposed as answer by Ter-ray-cy Wednesday, April 7, 2010 5:43 AM
    Tuesday, March 23, 2010 5:31 PM