How to parse Nullable from a SqlDataReader

后端 未结 6 743
情歌与酒
情歌与酒 2021-01-17 17:37

The DateTime.TryParse method takes a DateTime as an argument, not a DateTime? ?

Right now I have the following code:

if(!DateTime.TryParse(reader[\"P         


        
6条回答
  •  花落未央
    2021-01-17 17:55

    It's normal. The out argument is not set if the parse fail. So if the type of the wargument were Nullable it would have been a redudant information.

提交回复
热议问题