این تابع بارگذاری سوالات و همچنین جواب درست:
void load_question(string code)
{
cl.creatconnection();
cl.command.CommandText = "select * from tbl_fouropque where codesoal=" + code;
cl.reader = cl.command.ExecuteReader();
cl.reader.Read();
title.Text = cl.reader["soal"].ToString();
optionright = cl.reader["opright"].ToString();
if (cl.reader["type"].ToString()=="four")
{
gozine1.Text = cl.reader["op1"].ToString();
gozine2.Text = cl.reader["op2"].ToString();
gozine3.Text = cl.reader["op3"].ToString();
gozine4.Text = cl.reader["op4"].ToString();
gozine3.Visible = true;
gozine4.Visible = true;
}
elseif (cl.reader["type"].ToString()=="tow")
{
gozine1.Text = "بله";
gozine2.Text = "نه";
gozine3.Visible = false;
gozine4.Visible = false;
}
cl.connection.Close();
}