c# - choose only related columns ignoring rest -


i have 1 question paper when start test got next question according id topic ids randomly means topic ids alternately. suppose topic id 4 , primary keys alternatively when click next question got blank if topic id not 4 please me

here code

    private void getquestion(int no)     {     //con.open();     //    sqlcommand cmd = new sqlcommand("select count(topicid) quetionbank topicid='"+topicid+"'", con);     //   int32 count1 = (int32)cmd.executescalar();     //  lbltotque.text = count1.tostring();     //  con.close();          topicid=((practice_test)frm1).cmbtopic.selectedvalue.tostring();         // clear();         if (incquestion <= 40)//&& topicid!= null         {              string str = "select * quetionbank  topicid='" + topicid + "' , quetionid='" + no + "' ";             sqldataadapter da = new sqldataadapter(str, con);             dataset ds = new dataset();             da.fill(ds, "quetionbank");             //    da.fill(ds, "answer");              if (ds.tables[0].rows.count > 0)             {                 datarow dtr;                 int = 0;                 while (i < ds.tables[0].rows.count)                 {                     dtr = ds.tables[0].rows[i];                     //   session["answer"] = convert.tostring(convert.toint32(dtr["correct"].tostring()) - 1);                lblquestionno.text =+ incquestion + " " +"/100".tostring();                lblquestionid.text = dtr["quetionid"].tostring();                rtfdirection.text = dtr["direction"].tostring();                rtfquestion.text = dtr["question"].tostring();                rboptiona.text=(dtr["optiona"].tostring());                rboptionb.text=(dtr["optionb"].tostring());                rboptionc.text = (dtr["optionc"].tostring());                rboptiond.text = (dtr["optiond"].tostring());                rtboptione.text = (dtr["optione"].tostring());                rtbsolution.text = (dtr["solution"].tostring());                     //pbdirection.imagelocation= dtr["image_direction"].tostring();                     //pbquestion.imagelocation = dtr["image_quetion"].tostring();                     //pboptiona.imagelocation = dtr["image_optiona"].tostring();                     //pboptionb.imagelocation = dtr["image_optionb"].tostring();                     //pboptionc.imagelocation = dtr["image_optionc"].tostring();                     //pboptiond.imagelocation = dtr["image_optiond"].tostring();                     //pboptione.imagelocation = dtr["image_optione"].tostring();                     //pbsolution.imagelocation = dtr["image_solution"].tostring();                lblcorrect.text = dtr["correctans"].tostring();                     i++;                   }             incquestion += 1;             }              }               // }          //} 


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -