|
-
Mar 27th, 2007, 01:48 AM
#1
Thread Starter
Addicted Member
how can i select from table using many string values from text box?
how can i select from table using many string values from text box?
create table mytable( country varchar(30), city varchar(30))
insert into mytable values('Ethiopia','Addis Ababa')
insert into mytable values('Kenya','Nairobi')
insert into mytable values('France','Paris')
insert into mytable values('Japan','Tokyo')
then i have a text box that receives countries.
when i try to enter Ethiopia kenya,
i will expect to get Addis Ababa Kenya,
if i enter France Japan Ethiopia,
i will expect to get Paris Tokyo Addis Ababa
I think all this has done using split if i am not wrong.
so could you show me how can i select such conditions?
note that the value of textbox is more than one countries,
but i know when the value of textbox is one country only.
dim str as string
str="select city from mytable where country=' "&textbox1.text&" '"
my problem when i try to enter two or more countries name at same time.
sorry for posting again!
your help is crucial 4 me!
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|