kovalev24
Messages postés6Date d'inscriptionmardi 17 mars 2009StatutMembreDernière intervention17 mars 2009
-
23 janv. 2009 à 18:51
kovalev24
Messages postés6Date d'inscriptionmardi 17 mars 2009StatutMembreDernière intervention17 mars 2009
-
23 janv. 2009 à 20:07
bonjour,
j'ai un message d'erreur qui s'affiche des fois dans une application vb.net qui genere des fichiers excel et envoi un mail par smtp, je vous vais mettre le message si qlq a une idee svp.
System.ArgumentOutOfRangeException: L'index et la longueur doivent faire référence à un emplacement situé dans la chaîne. Nom du paramètre : length à System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) à System.String.Substring(Int32 startIndex, Int32 length) à PoMailPh.frmPrinc.fct_send_mail(String m_from, String m_to, String m_subject, Int32 m_type, String m_msg, String f_name) à PoMailPh.frmPrinc.fct_fill_excel(String[] lines, String sqltype) à PoMailPh.frmPrinc.procVerifFichier()
Supra3000
Messages postés159Date d'inscriptionlundi 18 février 2008StatutMembreDernière intervention 8 janvier 20102 23 janv. 2009 à 20:02
En remontant on peux voir que ta fonction : "fct_fill_excel" qui appelle la fonction "fct_send_mail"..
"à System.String.Substring(Int32 startIndex, Int32 length) à PoMailPh.frmPrinc.fct_send_mail"
Donc ta fonction Substring a une erreur de logique, je crois que cette fonction essai de récupérer une valeur trop grande par rapport au string envoyer, d'ou l'erreur :Nom du paramètre :
"length à System.String.InternalSubStringWithChecks"
Exemple: tu essaie de faire un "sFiles(i).Substring(27, 2).ToUpper"
sur une String trop courte.