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 |
|
anilr499
Starting Member
18 Posts |
Posted - 2012-07-18 : 22:32:09
|
| hi,i have query likeSELECT * FROM emp WHERE C_MAIN='" & sNAME & "'here sNAME is the name which i select from dropdownlist..so,now my question is...how can keep a for loop in this query so that i can passmultiple sname's(using list box) through this querysomething like thiseg: SELECT * FROM emp WHERE C_MAIN='" & sNAME & "' or c_main='" & sNAME & "' or C_MAIN='" & sNAME & "'..............can somebody help me in writing this query with loopthank you. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-19 : 00:01:41
|
| no need of loop. just pass them as a list as article says------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
anilr499
Starting Member
18 Posts |
Posted - 2012-07-19 : 00:29:59
|
quote: Originally posted by visakh16 no need of loop. just pass them as a list as article says------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
hi can u suggest me some examples..in my requirement i may select 'n' number of names from listbox...then how can i write query ...thank you |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-07-19 : 00:33:32
|
quote: Originally posted by anilr499
quote: Originally posted by visakh16 no need of loop. just pass them as a list as article says------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
hi can u suggest me some examples..in my requirement i may select 'n' number of names from listbox...then how can i write query ...thank you
Have you take a look at the link that i posted ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|