
Problem in Randomly access data from database
I have ms access database and i have a table named Test(ID(primary key),Type,Question,Option1,Option2,Option3,Option4,Answer) and i getting error in it..



Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 23, 2014, 8:57 AM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 22, 2014, 9:37 AM EDT
One thing I notice is that you're using comboBox1.Text to set the parameter which could be empty.
Instead of that I'd try comboBox1.SelectedItem.ToString().
Ajay Kadian128 reputationPosted Mar 22, 2014, 9:47 AM EDT
select *,rnd(ID) from Test order by rnd(ID)
But there is a problem when i run after closing app the sequence of question are same ..
VulpesRank #55 · 29.2K reputationPosted Mar 22, 2014, 11:15 AM EDT
If it didn't then try hard-coding a value for the 'type' column:
select * from QUESTION order by rnd(ID) where[Type]='someValue'
Ajay Kadian128 reputationPosted Mar 22, 2014, 10:21 PM EDT
I have one more question can we rotate set of 4-5 images clockwise in picture box on form load on timer_tick event..
VulpesRank #55 · 29.2K reputationPosted Mar 23, 2014, 6:30 AM EDT
timer1.Interval =3000;
timer1.Start();
Ajay Kadian128 reputationPosted Mar 23, 2014, 7:37 AM EDT
Ajay Kadian128 reputationPosted Mar 23, 2014, 9:14 AM EDT
And in this line
VulpesRank #55 · 29.2K reputationPosted Mar 23, 2014, 9:24 AM EDT
Ajay Kadian128 reputationPosted Mar 23, 2014, 9:30 AM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 23, 2014, 9:35 AM EDT
pictureBox1.Image = images[imageIndex];
Other than that it's working fine.
Ajay Kadian128 reputationPosted Mar 23, 2014, 9:41 AM EDT