I'm trying to convert a data from excel to type of my field in database but I got the above error:
string query = "Insert into Réception_camions([Date d'arrivée],[heure d'arrivée],Poids_cam,Id_cam,Id_qualité) Values('" +DateTime.Parse(ds.Tables[0].Rows[i][0].ToString()) + "','" + /*TimeSpan.Parse*/(ds.Tables[0].Rows[i][1].ToString()) + "','" + ds.Tables[0].Rows[i][2].ToString() + "','" + ds.Tables[0].Rows[i][3].ToString() + "','" + ds.Tables[0].Rows[i][4].ToString() + "')";
Is there an other way to convert to datetime?