473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to use string values? I really need help for this. Thanks.

Hello,

I am working on an ASP.NET/VB web site with Microsoft SQL 2000 database.

I have a page with a search form where keywords are submitted.
Consider I write the the keywords 'asp' and 'book'. The results page is
called as follows: results.aspx?search=asp%20book

Then I use this script in results.aspx to put the keywords in a string:

Sub Page_Load(sender As Object, e As System.EventArgs)
Dim keywords() As String =
Request.QueryString("search").Split(CChar(""))
End Sub

My table is set for FULL TEXT SEARCH.
Consider the SQL when I look for records containing 'asp' and 'book':

SELECT *
FROM dbo.documents
WHERE CONTAINS (*, 'ASP or BOOK')

This SQL looks only for these words. What I need is to look for records
that contain the Keywords included in the string keywords().

Can you tell me how to access the string values in the SQL and use it?

Thank You,
Miguel

Nov 19 '05 #1
1 1091
Leo
How about:

dim key as string = request.querystring("search").replace(" ", " or ")
this should turn the "asp book" into asp or book"
then
dim strSQL as string=string.format("SELECT * FROM dbo.documents WHERE
CONTAINS(*, '{0}), key)

"Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
Hello,

I am working on an ASP.NET/VB web site with Microsoft SQL 2000 database.

I have a page with a search form where keywords are submitted.
Consider I write the the keywords 'asp' and 'book'. The results page is
called as follows: results.aspx?search=asp%20book

Then I use this script in results.aspx to put the keywords in a string:

Sub Page_Load(sender As Object, e As System.EventArgs)
Dim keywords() As String = Request.QueryString("search").Split(CChar(""))
End Sub

My table is set for FULL TEXT SEARCH.
Consider the SQL when I look for records containing 'asp' and 'book':

SELECT *
FROM dbo.documents
WHERE CONTAINS (*, 'ASP or BOOK')

This SQL looks only for these words. What I need is to look for records
that contain the Keywords included in the string keywords().

Can you tell me how to access the string values in the SQL and use it?

Thank You,
Miguel

Nov 19 '05 #2

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

Similar topics

6
by: ASPfool | last post by:
Hello everyone, Please help me before I throw my computer out of the window: I'm working on a web application in classic ASP (vbscript), which is making calls to some webservices. The calls...
8
by: Grant Wagner | last post by:
I'm a bit confused by String() (typeof 'string') vs new String() (typeof 'object'). When you need to access a method or property of a -String-, what type is JavaScript expecting (or rather, what...
4
by: Vinay Agarwal | last post by:
Hello, I would like to maximize efficiency of string processing in my C# application that works with Skype API. Actually, these "strings" are made of "chars" that are all 8-bit values except 0...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: ___Newbie___ | last post by:
Hello, Why can't a string handle null values? Do I really need to check with IsDBNull() for null values? e.g. fieldName = reader.GetString(0); if (!reader.IsDBNull(1)) { fieldNationality =...
5
by: djc | last post by:
I need to prepare a large text database field to display in an asp.net repeater control. Currently I am replacing all chr(13)'s with a "<br/>" and it works fine. However, now I also want to be able...
5
by: Chris H | last post by:
Okay, I am trying to us a varialble with a list of number values as my data for an array, yet when I do this it doesnt return any values from the array, i was able to temporarily fix the proble by...
15
by: Fariba | last post by:
Hello , I am trying to call a mthod with the following signature: AddRole(string Group_Nam, string Description, int permissionmask); Accroding to msdn ,you can mask the permissions using...
2
by: ILCSP | last post by:
Hi, I have a sql table containing the answers for some tests. The information in this table is presented vertically and I need to create strings with them. I know how to read the data in VB.Net...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.