private void ClearETLTables() { MySqlDAL mySqlDAL = new MySqlDAL(mySqlConnString); bool nonQueryExecuted = false; string sqlStatement = "DELETE FROM migration.ETL_Results"; nonQueryExecuted = mySqlDAL.ExecuteNonQuery(sqlStatement); if (nonQueryExecuted) { ListBoxInfo.Items.Add("ETL_Results table cleared."); } else { ListBoxInfo.Items.Add("Failed to clear table ETL_Results."); } nonQueryExecuted = false; sqlStatement = "DELETE FROM etl_attributes"; nonQueryExecuted = mySqlDAL.ExecuteNonQuery(sqlStatement); if (nonQueryExecuted) { ListBoxInfo.Items.Add("etl_attributes table cleared."); } else { ListBoxInfo.Items.Add("Failed to clear table etl_attributes."); } }
public void WriteReportDataEntry(string DataEntity, int SuccessfulRows, int ErrorRows, string Notes = "") { MySqlDAL mySqlDAL = new MySqlDAL(); if (ErrorRows == 0) { mySqlDAL.ExecuteNonQuery("INSERT INTO ETL_Results (EventTime, ResultSummary, ResultDetail, Notes) " + "VALUES ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', '" + SuccessfulRows + " " + DataEntity + " rows copied.', '" + Notes + "')"); } else { mySqlDAL.ExecuteNonQuery("INSERT INTO ETL_Results (EventTime, ResultSummary, ResultDetail, Notes) " + "VALUES ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', '" + SuccessfulRows + " " + DataEntity + " rows copied.', '" + ErrorRows + " rows had errors.', '" + Notes + "')"); } }
public void WriteReportEntry(string Summary, string Details, string Notes) { MySqlDAL mySqlDAL = new MySqlDAL(); mySqlDAL.ExecuteNonQuery("INSERT INTO ETL_Results (EventTime, ResultSummary, ResultDetail, Notes) " + "VALUES ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', '" + Summary + "', '" + Details + "', '" + Notes + "')"); }
private bool ClearTables() { string sqlStatement = ""; bool nonQueryExecuted = false; bool allExecuted = true; MySqlDAL mySqlDAL = new MySqlDAL(mySqlConnString); foreach (string s in listOfMigrationTables) { sqlStatement = "DELETE FROM migration." + s; nonQueryExecuted = mySqlDAL.ExecuteNonQuery(sqlStatement); if (!nonQueryExecuted) { allExecuted = false; ListBoxInfo.Items.Add("Failed to clear table " + s.ToString()); } } return(allExecuted); }