StreamWriter.WriteLine & IndexOutOfRangeException
Bonjour,
J'aimerais comprendre comment la méthode StreamWriter.WriteLine peut causer une exception du type IndexOutOfRange.
Je cherche le tableau (ou équivalent) mais je n'en vois pas. (Bon ok une string est fondamentalement un tableau de caractères mais je doute que le souci se trouve là).
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
Public Sub thread3()
'thread chargé du traitement des données : écriture dans un fichier
If Not dsTrait Is Nothing AndAlso dsTrait.Tables.Count > 0 Then
For Each row As DataRow In dsTrait.Tables(0).Rows
line = ""
For Each col As DataColumn In dsTrait.Tables(0).Columns
line += row.Item(col.ColumnName).ToString & Chr(9)
Next
SW.WriteLine(line)
Next
End If
End Sub |
L'erreur se produit sur la ligne en rouge.
Quelqu'un aurait-il une idée ?
Griftou.