DateTimePicker Problem

kekinlim

Member
Joined
Jan 12, 2005
Messages
10
Programming Experience
Beginner
Hi everyone,

I have this form with textboxes and a datatimepicker. After i call .addnew to create a new record and upon pressing the save button, it shows a error, stating that the date field in the database cannot accept null value. The default value of the datatimepicker is set to "today" date. However, if i choose a date, then the record will be inserted successfully. Can anyone help me with this problem. THank you for the time spend.

Kekin
New vb.net programmer
 
try to set you datetimepicker this way
VB.NET:
Me.DateTimePicker1.Format = DateTimePickerFormat.Custom
		Me.DateTimePicker1.CustomFormat = "MM/dd/yyyy"
 
Back
Top