Export from vb.net to csv file

Does anyone know how to export the results of a query to a csv file in vb.net 4.0?

Thanks
ajdarlowAsked:
Who is Participating?
 
MrC63Connect With a Mentor Commented:
The File System Object (fso) is one way to do it.  See the following link:

http://msdn.microsoft.com/en-us/library/aa711216%28v=vs.71%29.aspx
0
 
Meir RivkinFull stack Software EngineerCommented:
can u post the code u use to query the results?
are you getting datatable/dataset as results or datareader?
0
 
ajdarlowAuthor Commented:
Thanks guys.

In the end I used the following


        My.Computer.FileSystem.DeleteFile(strFileName)

        mySqlDataAdapter.Fill(myDataSet, "Tags")
        For Each myDataRow In myDataSet.Tables("Tags").Rows
            strText = myDataRow("TagId") & ", " & myDataRow("TagDesc") & vbCrLf
            My.Computer.FileSystem.WriteAllText(strFileName, strText, True)
        Next myDataRow
0
All Courses

From novice to tech pro — start learning today.