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

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());
}

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha