本文介绍了如何动态增加DataTable的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了与数据库的连接
但是当我增加单选按钮列表中的值时,它不会增加......

表示
更改问题后,其选项也会更改
但是反面它的值不是该选项的值,它显示第一个问题选项,,,,

所以请给我答案......


这是代码...

I had already done the connection with database
but when I increase the value in the radio button list it doesn''t increase the...........

means
When question is changed it''s option also changed
but in back hand it value is not come of that option it display first question option,,,,,

So plz give me answer...............


here is code......

Label2.Text = Convert.ToString(ds.Tables(0).Rows(Session("point"))(1))
RadioButtonList1.Items(0).Text = (ds.Tables(0).Rows(Session("point"))(2))
RadioButtonList1.Items(1).Text = Convert.ToString(ds.Tables(0).Rows(Session("point"))(3))
RadioButtonList1.Items(2).Text = Convert.ToString(ds.Tables(0).Rows(Session("point"))(4))
RadioButtonList1.Items(3).Text = Convert.ToString(ds.Tables(0).Rows(Session("point"))(5))





If CInt(Label4.Text) > 0 Then
          str = RadioButtonList1.SelectedValue
          con.Open()
          cmd = New OleDbCommand("select * from unixquedb where qno=" & CInt(Label4.Text) & " and ans ='" & str & "' ", con)
          dr1 = cmd.ExecuteReader()
          If dr1.Read = True Then
              ' "select * from unixquedb where ans ='" & str & "'" Then
              marks = +1
          End If
      End If

推荐答案


这篇关于如何动态增加DataTable的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 13:47