Hi.....
In some cases the date field wil not b madatory.User no need to select a date. So we need to keep datetimepicker field blank, so that we can enter null for that field in db.
Plzzz........ help me
thanku
diya
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Marimuthu ArigovindasamyPosted Jun 23, 2010, 9:21 PM
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = " ";
dateTimePicker1.Value = DateTime.FromOADate(0);
dateTimePicker1.Enabled = false;
To store the control value in DB, use dateTimePicker1.Text