hello all
how to place DBNull value into a datetime field using c# code .
the field is already have a value .and I want to change it to DBNULL
tq
denny
How to place a dbnull value
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

paul daniel189 reputationPosted Mar 8, 2010, 10:01 PM EST
http://www.c-sharpcorner.com/UploadFile/sd_patel/EnterNullValuesForDateTime11222005015742AM/EnterNullValuesForDateTime.aspx
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 8, 2010, 10:13 PM EST
Simply use following query syntax:
cmd.CommandText="update table1 set DateAdded="+DBNULL+" where DateAdded="+DateTime.Now;
Please mark as answer if it helps you.
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 8, 2010, 10:41 PM EST
hello Denny
if you are using sql database then simply you can use this Query:
update temp_table set Date_field=NULL where Date_field is not Null
thank you
please chk answere if you like