How to create this simple string?

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

I am working on ASP.NET/VB. I have this string:
Dim keywords() As String =
Request.QueryString("search").Split(CChar(""))

Now I want to define a new string like this:
keywordsSQL = CONTAINS (*, 'keyword(1)') AND CONTAINS (*, 'keyword(2)')
AND ... CONTAINS (*, 'keyword(i)')

keyword(1) and keyword(i) are the first and last values in keywords().

How can I do this?

Thanks,
Miguel
 
dim first as string = keywords(0)
dim last as string = keywords( keywords.Length - 1)

just an idea

Pazu
 
You're creating an array of keywords. You want to concatentate conditions
into your SQL with them, so, you need to create a loop that loops through
the array ands adds conditions to the string.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
I am working on ASP.NET/VB. I have this string:
Dim keywords() As String =
Request.QueryString("search").Split(CChar(""))

Now I want to define a new string like this:
keywordsSQL = CONTAINS (*, 'keyword(1)') AND CONTAINS (*, 'keyword(2)')
AND ... CONTAINS (*, 'keyword(i)')

keyword(1) and keyword(i) are the first and last values in keywords().

How can I do this?

Take a look at SQL Parameters... they're great for what you're doing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top