DateTime.MinValue and SqlDateTime overflow

前端 未结 10 529
北恋
北恋 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 01:16

    Well... its quite simple to get a SQL min date

    DateTime sqlMinDateAsNetDateTime = System.Data.SqlTypes.SqlDateTime.MinValue.Value;
    

提交回复
热议问题