2
Answers

How to retrive data from database to Radiobutton ?

Rishav Mandal

Rishav Mandal

8y
860
1
I want to know , how to fetch data from database(4 Options) to Radio button Control and the Question in a Label Control in ASP.NET, just like Online Examination MCQ Qustions ..
Please Help me
Answers (2)
0
Jasbeer Singh

Jasbeer Singh

NA 7.1k 554k 8y
Hi Rishav,
 
you can fetch data and bind it dynamically according to question no. and options.
you can take radiobutton list to bind the options dynamically.
you can bind the daasource to radiobutton list.
 
 
 
 
0
Nitin Sontakke

Nitin Sontakke

137 13.6k 15.2k 8y
Not sure if you are using any framework (EF, etc)
 
You will need to do this in code. Assume, you get either 1 or 2 or 3 or 4 from the database.
 
Then, in c# you write (something) like this...
 
radioButton1.checked = radioButton2.checked = radioButton3.checked = radioButton.checked = false; 
switch(radioButtonValueFromDb) 
{
   case 1:
       radioButton1.checked = true;
 
//all other 3 values...