Friday, July 5, 2013

assign null value

DateTime? dt = sqldatareader[0] as DateTime?;

you can do it like that:
DateTime ? dt = (string1 == string2) ? new Nullable <DateTime>(): (DateTime)(txtbox.Text);

No comments:

Post a Comment