Public Sub setques() cm = New SqlCommand("select * from ques_mst where ques_id='" & rbl_ques.Text & "' ", con) da = New SqlDataAdapter(cm) ds = New DataSet da.Fill(ds, "q2") If ds.Tables("q2").Rows.Count > 0 Then If q <= ds.Tables("q2").Rows.Count Then Me.tb_qid.Text = ds.Tables("q2").Rows(q).Item("ques_id").ToString Me.tb_ques.Text = ds.Tables("q2").Rows(q).Item("ques_txt").ToString q = q + 1 End If cm = New SqlCommand("select * from option_mst where ques_id = '" & rbl_ques.SelectedValue & "'", con) da = New SqlDataAdapter(cm) ds = New DataSet da.Fill(ds, "o1") rbl_option.Items.Clear() If ds.Tables("o1").Rows.Count > 0 Then i = ds.Tables("o1").Rows.Count c = 0 While c < i Me.rbl_option.Items.Add(ds.Tables("o1").Rows(c).Item("option_txt").ToString) c = c + 1 End While End If End If c = 0 i = 0 End Sub Public Sub getqid() cm = New SqlCommand("select * from ques_mst ", con) da = New SqlDataAdapter(cm) ds = New DataSet da.Fill(ds, "q2") rbl_option.Items.Clear() If ds.Tables("q2").Rows.Count > 0 Then i = ds.Tables("q2").Rows.Count c = 0 While c < i Me.rbl_ques.Items.Add(ds.Tables("q2").Rows(c).Item("ques_id").ToString) c = c + 1 End While End If i = 0 c = 0 End Sub Protected Sub rbl_ques_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbl_ques.SelectedIndexChanged setques() End Sub Protected Sub b_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles b_submit.Click cm = New SqlCommand("select * from feedback_detail_mst where ques_id='" & rbl_ques.SelectedValue & "'", con) da = New SqlDataAdapter(cm) ds = New DataSet da.Fill(ds, "fd") If ds.Tables("fd").Rows.Count > 0 Then MsgBox("Question already attemped", MsgBoxStyle.Critical, "FACULTY APPRAISAL") Else ds.Tables("fd").Columns.Add("qid") ds.Tables("fd").Columns.Add("option_txt") dr(1) = ds.Tables.Add.Rows(1).Item("ques_id").ToString 'dr(1) = rbl_option.SelectedItem.Text MsgBox(dt) End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)