DateTime.MinValue and SqlDateTime overflow

前端 未结 10 549
北恋
北恋 2021-02-01 00:44

I don\'t want to validate txtBirthDate so I want to pass DateTime.MinValue in database.

My code:

 if (txtBirthDate.Text == st         


        
10条回答
  •  太阳男子
    2021-02-01 00:56

    Very simple avoid using DateTime.MinValue use System.Data.SqlTypes.SqlDateTime.MinValue instead.

提交回复
热议问题