标签:not datarow project question ast data instead www tps
dt.Columns.Add("EffectiveDate", typeof(DateTime)); DateTime? effectivedate=null; if (lastRow["Effective_x0020_Date"] != DBNull.Value) { effectivedate = Convert.ToDateTime(lastRow["Effective_x0020_Date"]); } DataRow dr = dt.NewRow(); dr["EffectiveDate"] = effectivedate; dt.Rows.Add(dr);
Fix
dr["EffectiveDate"] = effectivedate ?? (object)DBNull.Value;
来源:https://www.codeproject.com/Questions/867120/Cannot-set-Column-EffectiveDate-to-be-null-Please
Cannot set Column 'EffectiveDate' to be null. Please use DBNull instead.
标签:not datarow project question ast data instead www tps
原文地址:https://www.cnblogs.com/shy1766IT/p/13809711.html