Erreur d exception

Résolu
C#debutant Messages postés 7 Date d'inscription mercredi 2 avril 2014 Statut Membre Dernière intervention 23 avril 2014 - Modifié par C#debutant le 17/04/2014 à 11:22
C#debutant Messages postés 7 Date d'inscription mercredi 2 avril 2014 Statut Membre Dernière intervention 23 avril 2014 - 17 avril 2014 à 15:28
Bonjour,
Je travail sur une datagrid, lors du passage a la ligne suivante je veux calculer un montant cependant j obtiens l erreur stackoverflow exception n a pas été gérée j'y comprend pas grand chose quelqu'un peut il m'aider. merci
void Commande_RowChanging(object sender, DataRowChangeEventArgs e)
{
try
{
if (details.Rows.Count > 0)
{

Boolean b=false;
int articles = 0;
if (details.Tag.ToString() != "pas ok")
{
details.Tag = "pasok";
this.tbmontantramenea.Tag = "pasok";
//je parcours ma feuille de données
for (int j = details.Rows.Count - 1; j >= 0; j--)
{
Application.DoEvents();
if (b == false && this.details[2, j].Value != null && this.details[2, j].Value.ToString().Length != 0 && this.details[3, j].Value != null && this.details[3, j].Value.ToString() != "0,00" && this.details[4, j].Value != null && this.details[4, j].Value.ToString() != "0,00")
{
b = true;
}
if (b == false && this.details[3, j].Value != null && this.details[4, j].Value != null)
{
b = true;
}
//j'insere
if (b == true)
{
articles++;
}
}
L'erreur se produit lors de application.doevents

1 réponse

NHenry Messages postés 15112 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 13 avril 2024 159
17 avril 2014 à 12:22
Bonjour,

En, gros, ta fonction se rappel (directement ou non), place un point d'arrêt et fait un pas à pas pour voir où se fait la boucle.
0
C#debutant Messages postés 7 Date d'inscription mercredi 2 avril 2014 Statut Membre Dernière intervention 23 avril 2014
17 avril 2014 à 15:28
Merci bien j ai relu tout mon code est j avais écris la même chose 3 méthode avant du coup c'était de la récurrence.
0
Rejoignez-nous