Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
alxtech
Yak Posting Veteran
66 Posts |
Posted - 2006-02-02 : 09:08:40
|
| Problem:In a web form (vb.net) multiple selection from list box is allowed,Category List boxsportsnewsartscultureelectionsnight lifethree item selected: sports,news,cultureI am getting a string value from all selected choices like this:Dim listofstrings As StringDim item As ListItemFor Each item In listbox.ItemsIf item.Selected Thenlistofstrings = listofstrings & item.Text & ","End IfNextso i have listofstrings = (selectedvalue1,selectedvalue2,selectedvalue3,.......)I need to select all values from a table in database (sql2000) where any of those values corresponds.NOTE: Values in database can also be in the format of (value1,value2,value3,......) or just a single (value1,) |
|
|
szgldt
Starting Member
10 Posts |
Posted - 2006-02-02 : 09:21:13
|
| If I understand the issue then you could use the IN Clause.Your query would be similar to the followingSELECT *FROM TableNameWHERE Category IN ('sports','news', 'culture') |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|