I am writing to a text file from a datatable using the StreamWriter, but once it gets to a certain point in the data it returns it to the next line. Here is my code:
Here is the output you can see after the first address it goes to the next line below???Code:Dim strFilePath As String Dim stm As System.IO.StreamWriter strFilePath = "C:\WORK\Finished.txt" stm = New System.IO.StreamWriter(strFilePath, False) Dim i As Integer For i = 0 To dt.Columns.Count - 2 stm.Write(dt.Columns(i).ColumnName & ",") Next i stm.Write(dt.Columns(i).ColumnName) stm.WriteLine() For Each row As DataRow In dt.Rows Dim array() As Object = row.ItemArray For i = 0 To array.Length - 2 stm.Write(array(i).ToString() & ",") Next i Next row
![]()




Reply With Quote
