.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 16th, 2009, 07:08 PM
ngaisteve1's Avatar
ngaisteve1 ngaisteve1 is offline
ASP Free Member
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Kuala Lumpur, Malaysia (Boleh!)
Posts: 762 ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 11 h 28 m 28 sec
Reputation Power: 686
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.

Reply With Quote
  #2  
Old October 19th, 2009, 10:29 AM
ngaisteve1's Avatar
ngaisteve1 ngaisteve1 is offline
ASP Free Member
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Kuala Lumpur, Malaysia (Boleh!)
Posts: 762 ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level)ngaisteve1 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 11 h 28 m 28 sec
Reputation Power: 686
Found the fix at last.

Code:
         
   Dim dv As New DataView

            strSQL = "SELECT Causes_guid, Causes_Name FROM Causes "
            dtData = clsVM.getDataTable(strSQL)

            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 causes_guid FROM membercauses WHERE member_guid = '" & Session("MemberGUID") & "'  "
                dtData2 = clsVM.getDataTable(strSQL)

                For x As Integer = 0 To dtData2.Rows.Count - 1
                    Dim currentCheckBox As ListItem = chk_NGO_Causes.Items.FindByValue(dtData2.Rows(x)("causes_guid").ToString)
                    If Not (currentCheckBox Is Nothing) Then
                        currentCheckBox.Selected = True
                    End If
                Next
            Next
Comments on this post
micky agrees: Thanx for sharing the solution

Last edited by ngaisteve1 : October 19th, 2009 at 10:32 AM. Reason: clean up code

Reply With Quote
Closed Thread

Viewing: ASP Free ForumsProgramming.NET Development > Can't view multiple checkbox value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek