Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6826729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:10:57+00:00 2026-05-26T22:10:57+00:00

I have a delimiter string like this: 2,3 which is grabbed from a listbox

  • 0

I have a delimiter string like this: “2,3” which is grabbed from a listbox values which I will pass to my SProc parameter:

AddInParameter(dbCommand, "@Mode", DbType.String, 50, DBNull.Value)
                    If Not String.IsNullOrEmpty(.MemshpT) Then
                        dbCommand.Parameters("@Mode").Value = .MemshpT   'MemshipT will contain "2,3"

In my SProc I have a condition like this:

  and Cast(T.Mode as varchar(20)) in(@Mode))   

Now in my listbox which contains values: 1,2,3,4. If I select the values individually say ‘1’ and pass it to my SQL parameter, I will have all activity type 1 results in my gridview, but if I highlight more then 1 values it returns nothing because the string becomes like “2,3” which (Mode is not null and T.Mode like ‘%’ + @Mode + ‘%’) doesn’t seem to be able to catch. How can I reconstruct my delimiter or SQL query such that single as well as multiple delimited values (e.g. “1,2” will return all activity of 1 and 2) will be detected and be displayed in my gridview. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:10:58+00:00Added an answer on May 26, 2026 at 10:10 pm
    (T.Mode IN (@MODE))
    

    I’m assuming that MODE is integer data type and can only have 1 value per record.

    so your search string looks like 1,2,3,4

    the values in your database field mode look like

    1

    2

    3

    4

    I think you want to use the IN operator not like..

    which would result in 1 in (1,2,3,4)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: S=str1|str2|str3 I want extract another string from S
I have a string that looks like this: -2.2,1.1-6.9,2.3-12.8,2.3 And I want to write
I have a url string from which I want to capture all the words
I have the following String[] temp; which returns red blue green I would like
I have a string that occurs in this format: .word 40 I would like
I have a string which is basically a list of words delimited by commas.
After spliting a tab delimited file I have my required values in a string
Say I have the following string: s := 'This , is, the Delphi ,
Say I have a string with comma delimited values enclosed in single quotes that
what I need is simple thing, I have string which cantains data - time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.