private void GetQuestion() { string query = "SELECT QUESTION_ID, QUESTION_USER_ID, QUESTION_TEXT, ROW_INDEX FROM TB_USER_QUESTION"; using (DataTable dt = DBSqlite.GetSelectData(query)) { if (dt.Rows.Count > 0) { QuestionCollection.Clear(); foreach (DataRow dr in dt.Rows) { question Question = new question() { QUESTION_ID = dr["QUESTION_ID"].ToString(), QUESTION_USER_ID = dr["QUESTION_USER_ID"].ToString(), QUESTION_TEXT = dr["QUESTION_TEXT"].ToString(), ROW_INDEX = (int)dr["ROW_INDEX"] }; QuestionCollection.Add(Question); } } } }