Getting error: String reference not set to an instance of a String. Parameter name: s

前端 未结 1 943
难免孤独
难免孤独 2021-01-07 18:28

I am using this code to truncate datetime from my database into its year and time components. The variables YearOfRelease and Runtime contain datetime of the format \"

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 18:53

    The first parameter of DateTime.ParseExact is a string parameter named 's'.

    Therefore, it looks like YearOfRelease or RunTime is null in your program. Make sure those are set before you call DateTime.ParseExact.

    0 讨论(0)
提交回复
热议问题