It was easy for me to save a file on the database but saving a file as a (.csv) format is another issue for me before. Until I discover saving as a (.csv) format is just as simple as saving file on a database. All you just need to do on this is that to call the streamwriter to save the data as (.csv) format. I have here a sample codes below where the data the loaded on my listview was saved as (.csv) format. Hope you enjoy.

Private Sub SaveAsFile()

'They want to do a SaveAs, so find out what they want to name the file

Dim saveFileDialog As SaveFileDialog = New SaveFileDialog()

saveFileDialog.Title = "Save File"

saveFileDialog.Filter = "Files (*.csv)|*.csv|All Files (*.*)|*.*"

saveFileDialog.DefaultExt = "csv"

saveFileDialog.AddExtension = True

If saveFileDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then

filename = saveFileDialog.FileName

End If

Try
Dim csvFileContents As New System.Text.StringBuilder
Dim currentLine As String = String.Empty

'Write out the column names as headers for the csv file.
For columnIndex As Int32 = 0 To 0
currentLine &= (String.Format("mycolumn_name"))
Next

'Remove trailing comma

csvFileContents.AppendLine(currentLine.Substring(0, currentLine.Length))
currentLine = String.Empty

'Write out the data.
For Each item As ListViewItem In ListView1.Items

For Each subItem As ListViewItem.ListViewSubItem In item.SubItems

currentLine &= (String.Format("""{0}"",", subItem.Text))

Next
'Remove trailing comma

csvFileContents.AppendLine(currentLine.Substring(0, currentLine.Length - 1))
currentLine = String.Empty

Next

'Create the file.
Dim sw As New System.IO.StreamWriter(filename)
sw.WriteLine(csvFileContents.ToString)
sw.Flush()
sw.Dispose()
Catch ex As Exception

End Try

End Sub