Public Function WriteToCSV(ByVal dataTable As DataTable, ByVal filePath As String, ByVal records As ArrayList) As Boolean Dim fileStream As System.IO.FileStream Dim streamReader As System.IO.StreamReader Dim streamWriter As System.IO.StreamWriter Dim…