Ver Mensaje Individual
  #6 (permalink)  
Antiguo 04/01/2012, 04:52
Avatar de the_truth
the_truth
 
Fecha de Ingreso: enero-2012
Mensajes: 5
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Problema al recorrer Datagridview y volcar datos a .txt

Vale he dado con otra forma de hacerlo, es esta:
Dim ruta As String = My.Application.Info.DirectoryPath & ("\dni_no_existentes.txt")
Dim writer As IO.StreamWriter = New IO.StreamWriter(ruta)
Dim NCol As Integer = DGVDniNoExistentes.ColumnCount
Dim NRow As Integer = DGVDniNoExistentes.RowCount

'For i As Integer = 1 To NCol
' writer.WriteLine(DGVDniNoExistentes.Columns(i - 1).Name.ToString)
' DGVDniNoExistentes.CurrentRow.Cells("URL").Value()
' writer.WriteLine("")
'Next

For Fila As Integer = 0 To NRow - 1
writer.WriteLine(DGVDniNoExistentes.Rows(Fila).Cel ls("Dni").Value)
writer.WriteLine("")
Next

writer.Close()
MsgBox("Fichero de errores creado en ruta " + ruta)


azimutisima, sí miré el ejemplo de tu mensaje, pero no me iba y probé otras cosas, di con esta solución y la comparto aquí para todos. Un saludo.

Última edición por the_truth; 04/01/2012 a las 05:11