public void Load(ref Log returnLog) { Data = new DataSet(); try { returnLog.StartTime = DateTime.Now; Data = SQLDataExecutor.FillDataSet(this.ConnectionString, this.FillQuery); returnLog.Message = "Load Completed successfully. Record count:" + Data.Tables[0].Rows.Count; returnLog.EndTime = DateTime.Now; } catch (Exception ex) { returnLog.EndTime = DateTime.Now; returnLog.Successful = false; returnLog.Message = ex.Message; } }
public void Refresh(ref Log returnLog) { DataSet updatedDataSet = new DataSet(); try { returnLog.StartTime = DateTime.Now; updatedDataSet = SQLDataExecutor.FillDataSet(this.ConnectionString, this.FillQuery); returnLog.Message = "Refresh Completed successfully. Previous count:" + Data.Tables[0].Rows.Count + ". New count:" + updatedDataSet.Tables[0].Rows.Count; Data = updatedDataSet.Copy(); returnLog.EndTime = DateTime.Now; } catch (Exception ex) { returnLog.EndTime = DateTime.Now; returnLog.Successful = false; returnLog.Message = "Error in refresh:" + ex.Message; } }