//A method that returns an array that will later be written to a text file each element is a line of a text file
        private string[] getBadDates()
        {
            DataTable table;

            outTable = new DataTable();
            List <string> errorTypeCount = new List <string>();
            List <string> writeContents  = new List <string>();

            string[] columNames = { "STNID", "WISLRID", "END_VALID", "START_VALID" };

            DataBaseTools dbTools = new DataBaseTools();

            dbTools.progressUpdated      += dbTools_ProgressUpdated;
            dbTools.didReceiveFatalError += dbTools_didReceiveFatalError;
            table = dbTools.getDataTable(filePath, tableName);

            string stnId;
            string wislrId;
            string recordCreated;
            string recordHistoric;
            string startValid;
            string endValid;
            int    localErrorCount; //Local errorCount keeps up with errors per row while errorCount is total erros over the whole file the error count is displayed once date check is done

            int[] errors = { 0, 0, 0, 0 };

            foreach (string name in columNames)
            {
                outTable.Columns.Add(name);
            }

            for (int i = 0; i < table.Rows.Count; i++)
            {
                stnId           = table.Rows[i].ItemArray[0].ToString();
                wislrId         = table.Rows[i].ItemArray[3].ToString();
                recordCreated   = table.Rows[i].ItemArray[12].ToString();
                recordHistoric  = table.Rows[i].ItemArray[13].ToString();
                startValid      = table.Rows[i].ItemArray[14].ToString();
                endValid        = table.Rows[i].ItemArray[15].ToString();
                localErrorCount = 0;

                writeContents.Add("STNID: " + stnId + " WISLRID: " + wislrId + " {");        //The rows aren't always the same in our datatables and the datatable in access so we give them the stnid and wislrid

                if (string.IsNullOrEmpty(recordHistoric) && !string.IsNullOrEmpty(endValid)) //No end valid date for record historic
                {
                    writeContents.Add(Environment.NewLine + "    There is no Record Historic for End Valid (" + endValid + ")" + Environment.NewLine);
                    errors[0]++;
                    localErrorCount++;
                }

                if (DateTools.getLaterDate(endValid, startValid) == startValid)
                {
                    writeContents.Add(Environment.NewLine + "    Start Valid is more recent than End Valid (" + endValid + ")" + Environment.NewLine); //End valid is earlier than the start valid
                    errors[1]++;
                    localErrorCount++;
                }

                if (DateTools.getLaterDate(recordHistoric, startValid) == startValid) //Start valid is more recent than record historic
                {
                    writeContents.Add(Environment.NewLine + "    Start Valid is more recent than Record Historic" + Environment.NewLine);
                    errors[2]++;
                    localErrorCount++;
                }

                if (DateTools.getLaterDate(recordCreated, startValid) == startValid) //Start valid is more recent than record created
                {
                    writeContents.Add(Environment.NewLine + "    Start Valid is more recent than Record Created" + Environment.NewLine);
                    errors[3]++;
                    localErrorCount++;
                }

                if (localErrorCount == 0) //If we don't have errors here remove the opening line and brace
                {
                    writeContents.RemoveAt(writeContents.Count - 1);
                }
                else //If we have local errors close it off with a brace and a new line
                {
                    errorCount += localErrorCount; //Keep track of all errors
                    writeContents.Add("}\n");

                    DataRow currentRow = outTable.NewRow();
                    currentRow["STNID"]       = stnId;
                    currentRow["WISLRID"]     = wislrId;
                    currentRow["END_VALID"]   = endValid;
                    currentRow["START_VALID"] = startValid;
                    outTable.Rows.Add(currentRow);
                }
            }

            errorTypeCount.Add("Error types:\nThere is no Record Historic for End Valid: " + errors[0] + "\n");
            errorTypeCount.Add("Start Valid is more recent than End Valid: " + errors[1] + "\n");
            errorTypeCount.Add("Start Valid is more recent than Record Historic: " + errors[2] + "\n");
            errorTypeCount.Add("Start Valid is more recent than Record Created: " + errors[3] + "\n" + Environment.NewLine);

            return(errorTypeCount.ToArray().Concat(writeContents.ToArray()).ToArray()); //Return array of lines
        }