hi,i'm creating a "online examination website", my question is that how to select data from database one by one on button click event.
i'm preparing question page and fetching data on radiobuttonlist using to show answer and a label is used to show question
but i have problem is that on button click event i have not getting the next question from database,i'm using sql-server to backend.
please any one can send me the c# code to do that this thing.....my emailid "[email protected]"
Pankaj PandeyPosted Apr 15, 2013, 9:13 AM
You can use session to store data.
fetch data from database and store it in a data table and save it using session, now also put a variable x initialize with 0, on each button click, add "1" to x and again store it into session and store data table from session and using row property you can fetch next row on each click.
datatable dt=new datatable();
da.fill(dt);
session["data"]=dt;
and on each button click use like this..
dt.rows[x][columnfield].tostring();
thanx