This is my first 'serious' VB2008 project. Attempting to write a comma separated file. vis:
Is there a better method for outputing the data, rather than having to concatinate all the elements into a string and then writing it?Code:Dim JobC As Integer Dim iWrite As New StreamWriter("C:\LogTest.txt", False) Dim OutputLine As String For JobC = 1 To HelpDesk.Count jobs(JobC - 1) = New Jobs(HelpDesk(JobC), TypeA(JobC), Specialist(JobC), Comments(JobC), Summary(JobC), Description(JobC)) OutputLine = HelpDesk(JobC) + "," + TypeA(JobC) + "," + Specialist(JobC) + "," + Comments(JobC) + "," + Summary(JobC) + "," + Description(JobC) iWrite.WriteLine(OutputLine) Next iWrite.Close() dgv1.DataSource = jobs
In the 'good old VB6' days a Print statement followed by each value and a separator would do the trick. I can't seem to find the appropriate override for the WriteLine method.




Reply With Quote