[Solved] display value of database [closed]


Try something like this:

Global.dbCon.Open();

List<int> idQuestions = new List<int>();

kalimatSql = kalimatSql;

Global.reader = Global.riyeder(kalimatSql);

if (Global.reader.HasRows) {
   while (Global.reader.Read()) {
       int idQuestion = Convert.ToInt32(Global.reader.GetValue(0));

       idQuestions.Add(idQuestion);
   }
}

Global.dbCon.Close();

foreach (int id in idQuestions)
{
    messageBox.Show(id.ToString());
}

What we are doing here is adding all of the question ids into a list and then displaying each of them afterwards.

3

solved display value of database [closed]