bonjour
je veux supprimer des donnees de type datatime a partir d'un programme c# mais le probleme c est que apres l'execusion le programme il ne supprime pas les donnes a partir du 13 de chaque moi comme si il ne les considere que 12 jour par mois
pouvez vous m aidez dans ce problem je suis bloque
mon code est le suivant
merci d'avanceCode:public partial class purge2 : Form { string[] jours = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }; string[] mois = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }; string[] ans = { "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030"}; public purge2() { InitializeComponent(); daystart.Items.AddRange(jours); monthstart.Items.AddRange(mois); yearstart.Items.AddRange(ans); dayend.Items.AddRange(jours); monthend.Items.AddRange(mois); yearend.Items.AddRange(ans); // yearstart.Text = "" + DateTime.Now.Year; // yearend.Text = "" + DateTime.Now.Year; daystart.SelectedIndex = 0; dayend.SelectedIndex = 0; monthstart.SelectedIndex = 0; monthend.SelectedIndex = 0; yearstart.SelectedIndex = 0; yearend.SelectedIndex = 0; } private void Delete_Click(object sender, EventArgs e) { try { DateTime D1 = Convert.ToDateTime(yearstart.Text + "/" + monthstart.Text + "/" + daystart.Text + " 00:00:00.000"); DateTime D2 = Convert.ToDateTime(yearend.Text + "/" + monthend.Text + "/" + dayend.Text + " 00:00:00.000"); Program.connexion.Open(); SqlCommand myCommand = new SqlCommand("DELETE from Operation where Start_Date between '" + D1 + "' and '" + D2 + "'", Program.connexion); myCommand.ExecuteReader(); ; richTextBox.Text = "\n Archives between " + monthstart.Text + "/" + daystart.Text + "/" + yearstart.Text + " and " + monthend.Text + "/" + dayend.Text + "/" + yearend.Text + " are deleted succefully..."; } catch (Exception) { richTextBox.Text = "\nNo data... "; } Program.connexion.Close(); } }
-----