RE:Generar Archivo plano desde datagrid
Tengo esta funcion donde StrCadena contiene todo lo que le quiero mandar, tu ya le das el formato de las comas.
Ejemplo:
StrCAdena="algo" & "," & "mas_algo"
EscribeLog(StrCadena)
Espero haberte ayudado
Public Function EscribeLog(ByVal StrCadena As String) As Boolean
Dim Estado As String = ""
Dim strArchivo As String = CurDir()
strArchivo &= "Bitacora.txt"
FileOpen(2, strArchivo, OpenMode.Append, OpenAccess.Write, OpenShare.Shared)
If (Estado = "NO") Then
PrintLine(2, vbTab & "Bitacora de Errores en el equipo " & Archivo)
PrintLine(2, vbCrLf)
PrintLine(2, "---------------------------------------------------------------------------------------------------------------------------------------")
PrintLine(2, "SUBAREA" & " " & "SUBESTACION" & " " & "CLV EQUIPO" & " " & "NOM CAMPO" & " " & "VALOR INCORRECTO")
PrintLine(2, "---------------------------------------------------------------------------------------------------------------------------------------")
PrintLine(2, vbCrLf)
End If
PrintLine(2, StrCadena)
FileClose(2)
End Function