473,479 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to create this simple string?

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

Nov 19 '05 #1
3 1262
dim first as string = keywords(0)
dim last as string = keywords( keywords.Length - 1)

just an idea

Pazu

"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> píse v diskusním
príspevku news:%2****************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #2
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.

"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
news:#z**************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #3
"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in news:
#z**************@TK2MSFTNGP15.phx.gbl:
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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2827
by: DerekS | last post by:
Hi, I've been pulling my hair out trying to write a simple method to programatically create a system DSN with all parameters on a remote machine. I have ensured I have the correct permissions on...
5
2911
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
0
2019
by: Yogesh | last post by:
Hello Everyone I have to create Oracle tables in my application on the fly, which have an Autonumber field. So, everytime I create a table, I have to create a corresponding sequence and trigger...
9
2288
by: Marc Miller | last post by:
Hi all, I have 2 dev. machines, the 1st is Win 2000 with .NET 7.0 and the 2nd is XP Pro with .NET 2003. My Web Server is Win 2000 Server with IIS 5.0. I can create a new project on my test...
3
1082
by: Miguel Dias Moura | last post by:
Hello, I need to create a simple search in a web site. I have an input text where the user writes the words for search. When it clicks the "search" button a new page will appear with all the...
2
2112
by: Just D. | last post by:
All, Do we have a simple way to Create an object on the fly knowing just an object type? The usual design-time way is to write a code something like this: CObjectType obj = new CObjectType();...
4
1539
by: Daylor | last post by:
hi. i have multi thread application in vb.net is there a way NET support, so i can mark the class , to be access only for 1 thread each time ? if there is , small sytax sample will help ...
9
8245
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
27
3739
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
11
2908
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
0
7027
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5318
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4468
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2987
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
170
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.