在ASP.net和C#中开发在线Quize Bank [英] Developing Online Quize Bank in ASP.net and C#
问题描述
你好
我已经启动了一个异步学习系统
其中的问题将被上载到问题库(数据库).
并根据要求选择随机问题并将其显示给用户
带有问题和单选按钮的选择,然后在提交表单时将显示反馈.
可以使用哪种代码段从数据库中随机选择问题,
并以格式正确的方式显示它们?
Hello
I have started one as Asynchronous Learning system
in which Questions will be uploaded to a question bank (Database.)
and the upon request Random questions will be selected and displayed to the user
with question and Radio buttons for choices, then a feedback will be displayed when the form is submitted.
What kind of piece of code can be used to select questions from database randomly,
and display them in a well formed way???
推荐答案
您可以使用类似以下内容的内容:
You could use something like the following:
select top 1
Column1,
Column2,
...
from
Table_Name
tablesample (n percent)
其中n是1到100之间的任何整数.
这是一篇更详细的文章:使用TABLESAMPLE限制结果集 [
where n is any integer between 1 and 100.
Here is an article with more detail: Limiting Result Sets by Using TABLESAMPLE[^]
这篇关于在ASP.net和C#中开发在线Quize Bank的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!