
October 16th, 2009, 07:08 PM
|
 |
ASP Free Member
|
|
Join Date: Jan 2004
Location: Kuala Lumpur, Malaysia (Boleh!)
|
|
|
Can't view multiple checkbox value
Hi, I got a problem here. Below the code I use to select multiple checkbox from the database. But the problem is I can only see one selection and not multiple selection. Anyone here know why I only can see one selection?
Quote: Dim dv As New DataView
strSQL = "SELECT Causes_guid, Causes_Name FROM Causes "
dtData = clsVM.getDataTable(strSQL)
chk_NGO_Causes.DataSource = dtData
chk_NGO_Causes.DataValueField = "Causes_guid"
chk_NGO_Causes.DataTextField = "Causes_Name"
chk_NGO_Causes.DataBind()
For i As Integer = 0 To chk_NGO_Causes.Items.Count - 1
strSQL = "SELECT * FROM membercauses WHERE member_guid = '" & Session("MemberGUID") & "' "
dtData2 = clsVM.getDataTable(strSQL)
For x As Integer = 0 To dtData2.Rows.Count - 1
If chk_NGO_Causes.Items(i).Value = dtData2.Rows(x)("causes_guid").ToString Then
chk_NGO_Causes.SelectedValue = chk_NGO_Causes.Items(i).Value
End If
Next
Next |
__________________
My homepage - www.findingsteve.net
Greatest commandment - “Teacher, which is the greatest commandment in the Law?” Jesus replied: “ ‘Love the Lord your God with all your heart and with all your soul and with all your mind.’ This is the first and greatest commandment. And the second is like it: ‘Love your neighbor as yourself.’ ” Matthew 22: 36-40 (NIV, Bible)
Progress - " Sedikit-sedikit, lama-lama menjadi bukit." (Literal translation: Bit by bit, in the end it becomes a hill.)
Last edited by ngaisteve1 : October 16th, 2009 at 07:24 PM.
|