Goran Bibic

Goran Bibic

  • 480
  • 2.9k
  • 198.2k

Setup default value if is datetimepicker in sql column null

Mar 24 2018 11:05 AM
Setup default value if is datetimepicker in sql column null
 
Exp
  1. vrijemeodjaveDateTimePicker.Value = Convert.ToDateTime(string.IsNullOrWhiteSpace(vrijemeodjaveDateTimePicker.Text) ? emptydate : prijava_radnikaDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn3"].Value); 
Default value
  1. private DateTime emptydate = DateTime.Parse("2018-01-01 00:00:00");

Answers (38)