ListBox problem

Results 1 to 2 of 2

Thread: ListBox problem

  1. #1
    Join Date
    Dec 1969

    Default ListBox problem

    Anybody can give solutions for the multiple selected values of a listbox and populating a SQL stmt accordingly??<BR>Also please note that IN clause has a comma separated problem which shud not be ignored.<BR>The last selected value of the listbox will not have a comma at the end.<BR>Example:<BR>Select * from TEST where test_id IN (&#039;A&#039;,&#039;B&#039;)<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: ListBox problem

    Iterate the ListItems and check the Selected Property for each item. If it is true, append the value to the end of a string that holds the "IN" list. After you are out of the loop, check to see if the list ends with a comma - if it does, remove it. Lastly, combine the main sql statement with your "IN" criteria. What part are you having a problem with? What do you have so far?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts