//Check for updates on db public override async Task <LastModifies> CheckUpdates() { LastModifies LastLocalModifies = new LastModifies(); foreach (string t in Tables) { DataTable dt = await GetData(String.Format("SELECT MAX(lastmodify) FROM {0};", t)); if (dt.Rows[0][0].GetType() != typeof(DBNull)) { LastLocalModifies.List.Add(t, Convert.ToDateTime(dt.Rows[0][0])); } } return(LastLocalModifies); }
public override async Task <LastModifies> CheckUpdates() { LastModifies LastModifies = new LastModifies(); DataTable dt = await GetData(String.Format("SELECT UPDATE_TIME, TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA = '{0}'; ", DatabaseName)); foreach (DataRow row in dt.Rows) { if (row[0].GetType() != typeof(DBNull)) { LastModifies.List.Add(row[1].ToString(), Convert.ToDateTime(row[0])); } else { LastModifies.List.Add(row[1].ToString(), new DateTime(0)); } } return(LastModifies); }