I'm doing a project that consists of using a MySQL database with a graphical interface of C #, the point is that there is an item / element that consists of adding 2 dates but when compiling I get an error with the "DateTimePicker" ".
My code is as follows:
void BtnAgregarClick(object sender, EventArgs e){
String A,B,C,D,E;
A = txtCodigo.Text;
B = txtISBN.Text;
C = txtBoleta.Text;
D = dateTimePicker1.Text;
E = dateTimePicker2.Text;
if (A != "" && B != "" && C !=null && D != null && E != null){
string query = "INSERT INTO prestamo VALUES("+"'" + A + "'," + "'" + B + "'," + "'" + C +"'," + "'" + D + "'," + "'" + E + "')";
MessageBox.Show(query);
MainForm.Insert(query);
txtBoleta.Clear();
txtCodigo.Clear();
dateTimePicker1.Value == DateTime.Today;
dateTimePicker2.Value == DateTime.Today;
}
else
MessageBox.Show("Ingresa todos los datos");
}