如何在数据集中进行上一个和下一个 [英] how to go previous and next in Dataset

查看:75
本文介绍了如何在数据集中进行上一个和下一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在用C#创建一个测试屏幕,提出一个问题,并给出3个答案以选择一个和两个按钮(下一个和上一个)以获取下一个问题或返回上一个问题.数据集中的下一个和上一个.
我必须使用数据集而不是阅读器,因为我将保存用户为每个问题选择的答案.
谢谢

Hi all,

i''m creating a testing screen in c#, a question is asked and 3 answers is given to choose one and two buttons (next and previous) to get the next question or go back to the previous one.my queston is how to go next and previous in a dataset.
i have to use a dataset and not a reader because i will save the answer choosen by the user for each question.
Thanks

推荐答案

希望
Hope this[^] might help you.


//Consider having the following DataSet
DataSet myDS = new DataSet();

//Consider you filled your DataSet from somewhere
string question = myDS.Table["table_name"].Rows[rowNumber].["column_name"]


您要做的就是从rowNumber值中添加/减去来得出下一个/上一个问题.


All you have to do is to add / subrtact from the rowNumber value to get the next / previous question.


这篇关于如何在数据集中进行上一个和下一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆