Can you please tell me how to take the value from the textBox and write it in the database field with the data type "Date and time"?
Here's how I do it, but it's understandable not to cram a string into a date:
string zapr = "INSERT INTO СведенияОбУчениках (Дата_рождения) VALUES "+ "('" + Convert.ToString(c1_tb.Text) + "')"; OleDbCommand command = new OleDbCommand(zapr, myConnection); command.ExecuteNonQuery(); Where:
- Trainees - table in database
- Date of birth - field with type "Date and time"
- c1_tb - TextBox with entered data of type "03/02/2019"