bonjour à tous,
je veut supprimer des lignes dans une table mysql. j'ai crée une table qui contient les lignes à supprimer lors de l'exécution du code juste la 1ere ligne est supprimée ensuite j'ai le problème suivant :
voici le codeLa collection a été modifiée ; l'opération d'énumération risque de ne pas s'exécuter.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 foreach (DataRow pRow in data.Tables["C_Agricole"].Rows) { //BEGIN DELETE CODE findTheseVals[0] = pRow["identifiant_unique"].ToString(); findTheseVals[1] = global.Date(DateTime.Parse( pRow["date_constatation"].ToString())); drCurrent = tblC_Agricole.Rows.Find(findTheseVals); drCurrent = tblC_Agricole.Rows.Find(findTheseVals); drCurrent.Delete(); //END DELETE CODE // CLEAN UP SQL SERVER objCommandBuilder = new MySqlCommandBuilder(adapter); adapter.Update(data, "C_Agricole"); }
j'ai besoin de vos aides merci d'avance
Partager