Forum Moderators: open
The list itself is empty in the code below , but you should get the general idea. This will also work with a DataReader or DataSet.
Dim myList As New List(Of Person)
Dim sw As New StreamWriter(Server.MapPath("~/myFile.csv"))
For Each Person As Person In myList
sw.WriteLine(String.Format("{0},{1},{2}", Person.Name, Person.Surname, Person.DateOfBirth.ToShortDateString))
Next
sw.Close()
*Edit: for reading CSV files you can use the Microsoft.VisualBasic.FileIO.TextFieldParser namespace