項目を動的に変えてデータを取得

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());
}
© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha