I am new in VB.net, sql and even phpmyadmin gui. I want to record the date using DateTimePicker in vb.net. I was be able to record the data but date is the only one which is not recorded. It is appeared as 0000-00-00 in phpmyadmin. Type is DATE.
This is my code used in VB.NET:
date_of_confinement = Date.Parse(dtpDate.Value)
Dim SQLStatement As String = "INSERT INTO patient(date_of_confinement) VALUES('" & Date.Parse(dtpDate.Value) & "')"
SaveInfos(SQLStatement)
Any help would be appreciated. Thanks!
date_of_confinement =Format(dtpDate.Value, "yyyy-MM-dd")then insert this value to the query. MySQL will store the date in “yyyy-MM-dd” format.