|
-
Mar 27th, 2007, 01:42 AM
#1
Thread Starter
Addicted Member
[02/03]
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.
your help is crucial 4 me!
thanks
-
Mar 27th, 2007, 02:48 AM
#2
Fanatic Member
Re: [02/03]
From what I understand this can be done only if you have a pre-defined set of list. If that is the case then the following code snippet should work:
vb Code:
Dim str As String = "KenyaEthiopia"
Dim flag As Boolean = str.Contains("Kenya")
Console.WriteLine(flag)
Otherwise, I do not see how you'll build an inteligence to find out when does one word end and when the next starts.
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
|