Pick a random Entry from a database -
i trying code application me run quiz night.
i have different databases different categories want able randomly pick out question from, , show on screen.
so far have got:
if lcat.text = "film" lques.text = film_questiontextbox.text film_usedtextbox.text = "y" filmbindingsource.endedit() filmtableadapter.update(me.database1dataset) end if
this picks first question corresponding database, how make random question.
in t-sql @ least, can use sql single random row questions
table:
select top 1 * [questions] order newid()
the newid()
function generates random uniqueidentifier
every row.
Comments
Post a Comment