troubleshooting Question

Help with Query Statement

Avatar of vcharles
vcharles asked on
.NET ProgrammingASP.NETSQL
14 Comments1 Solution402 ViewsLast Modified:
Hello,

Can you please help me with the right syntax for "in (S)". Basically s represents the ID values already selected. I need to check it against each row and if found set the row as selected = true, problem is with my "in (S)" command.

        C1Country.DataSource = dtCountry
        C1Country.DataTextField = "Country"
        C1Country.DataValueField = "Country_ID"
        C1Country.DataBind()
        C1Country.Text = dtCountry.Rows(CurrentIndex).Item("Country")
        Dim S As String
        S = "1,2,6,7,11"
        For i = 0 To C1Country.Items.Count - 1
       if C1Country.Items(i).Text in (S) Then
                C1Country.Items(i).Selected = True
            End If
        Next
Thanks,
Victor
ASKER CERTIFIED SOLUTION
Rajar Ahmed
Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros