5月 032020
項目を動的に変えてデータを取得
void Start() { dbManager = this.GetComponentInParent(); } public int GetScore(int id, ExeMode method) { string item = CommonDao.GetScoreItemName(method); string sql = $"SELECT {item} FROM LessonTable WHERE ID=?"; SimpleDataTable lists = dbManager.QueryGeneric(sql, id); if(lists.rows.Count ==0 ) { return 0; } return int.Parse(lists.rows[0][0].ToString()); }