User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 373,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,138 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 2698 | Replies: 0
Join Date: Mar 2007
Posts: 34
Reputation: shy_wani is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
shy_wani shy_wani is offline Offline
Light Poster

add radiobutton list or checkboxes list

  #1  
Apr 29th, 2007
hi..i'm doing my final year project on creating Questionnaires template. i have problem with viewing my OptionLIst. I have 2 dataset..all i want to do is to preview all my Question & Answer..i can view them, but i need to create textboxes or checkboxes besides the OptionList..


 Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
 Dim questDA As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM Question WHERE SurveyID=83", MyConnection)
        Dim surveyDA As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM AnswerList WHERE SurveyID=83", MyConnection)
        Dim custDS As DataSet = New DataSet
        questDA.Fill(custDS, "Question")
        surveyDA.Fill(custDS, "AnswerList")
        MyConnection.Close()

        Dim custAnswerListrel As DataRelation = custDS.Relations.Add("CustAnswerList", _
                                             custDS.Tables("Question").Columns("QuestionID"), _
                                             custDS.Tables("AnswerList").Columns("QuestionID"))
        Dim pRow, cRow As DataRow
        Dim radlist As New RadioButtonList
        For Each pRow In custDS.Tables("Question").Rows
            Response.Write("<br>")
            'Response.Write(pRow("QuestionID").ToString())
            Response.Write(pRow("QuestionNum").ToString())
            Response.Write(pRow("Question").ToString())
            Response.Write("<br>")
            Response.Write(pRow("QuestionTypeID").ToString())
'suppose if QuestionTypeID="Radio" then the OptionList below should 'be listed wit RadioButton, else if QuestionTypeID="CheckBoxes"
'then the OptionList below should be listed with checkboxes...
            Response.Write("<br>")
            For Each cRow In pRow.GetChildRows(custAnswerListrel)
                Dim li As ListItem = New ListItem(cRow("OptionList"), cRow("OptionID"))
                         Response.Write(vbTab & cRow("OptionID").ToString())
                'Dim li As ListItem = New ListItem(cRow("OptionList"), cRow("OptionID"))
                Response.Write(cRow("OptionList").ToString())
                Response.Write("<br>")
            Next
        Next
InitializeComponent()
End Sub

can anyone help me? please...i really need your help..
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 6:22 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC