473,403 Members | 2,338 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,403 software developers and data experts.

adding a search capability

I have a sql server (2000) and I want to add a search capability to my
asp.net page. It will search an Articles table - in particular the
'Article' field (ntext).

I started with the following statement:
sql = "Select * from [articles] where article like '%" & tbquery.text & "%'
" order by dateposted desc, title"

and the results are fine if I only enter one word into the textbox - how can
I make it more functional (using and, or and such)

bj daniels

da******@gunnery.org


Nov 17 '05 #1
4 1546
bj,

I've taken a different direction. As a matter of fact I'm getting ready to
place the code for a search project I built out on my web site. Instead of
going to the database with a search I'm getting back a datatable of all
records and searching those. The method's I've built return a dataview.

So far it functions pretty quickly. I've tested it on up to 10,000 records
in the database of the on of the websites where I work, www.collect.com. (I
know 10,000 records isn't a lot) But in this case it's more than it seems
because this is our content database. And each article can be up to four or
five pages of text long.

It's pretty speedy so far.

I'll put the project out on my site by tomorrow.

If you want to test it I'm using it for my code library at
www.aboutfortunate.com.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"bj daniels" <da******@gunnery.org> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I have a sql server (2000) and I want to add a search capability to my
asp.net page. It will search an Articles table - in particular the
'Article' field (ntext).

I started with the following statement:
sql = "Select * from [articles] where article like '%" & tbquery.text & "%' " order by dateposted desc, title"

and the results are fine if I only enter one word into the textbox - how can I make it more functional (using and, or and such)

bj daniels

da******@gunnery.org


Nov 17 '05 #2
bj,

If you are interested in the search component I wrote it's on my web site in
the code library now. Just go to the code library and click the "Search"
button in the list of components on the left.

You'll have an option to download the entire project's source files and also
a help file that contains information for all the assemblies I've written.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"bj daniels" <da******@gunnery.org> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I have a sql server (2000) and I want to add a search capability to my
asp.net page. It will search an Articles table - in particular the
'Article' field (ntext).

I started with the following statement:
sql = "Select * from [articles] where article like '%" & tbquery.text & "%' " order by dateposted desc, title"

and the results are fine if I only enter one word into the textbox - how can I make it more functional (using and, or and such)

bj daniels

da******@gunnery.org


Nov 17 '05 #3
Can I use a validation control to only accept letters and numbers? How
would you recommend I do this?

bj daniels
da******@gunnery.org

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"bj daniels" <da******@gunnery.org> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I have a sql server (2000) and I want to add a search capability to my
asp.net page. It will search an Articles table - in particular the
'Article' field (ntext).

I started with the following statement:
sql = "Select * from [articles] where article like '%" & tbquery.text &

"%'
" order by dateposted desc, title"


BJ, what happens when the user enters into tbquery something like "--
<cr><lf>DELETE * FROM [ARTICLES]<cr><lf>"?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #4
thanks - I'll check that out!
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:uj**************@TK2MSFTNGP10.phx.gbl...
bj,

If you are interested in the search component I wrote it's on my web site in the code library now. Just go to the code library and click the "Search"
button in the list of components on the left.

You'll have an option to download the entire project's source files and also a help file that contains information for all the assemblies I've written.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"bj daniels" <da******@gunnery.org> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I have a sql server (2000) and I want to add a search capability to my
asp.net page. It will search an Articles table - in particular the
'Article' field (ntext).

I started with the following statement:
sql = "Select * from [articles] where article like '%" & tbquery.text &

"%'
" order by dateposted desc, title"

and the results are fine if I only enter one word into the textbox - how

can
I make it more functional (using and, or and such)

bj daniels

da******@gunnery.org



Nov 17 '05 #5

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

Similar topics

3
by: Job Lot | last post by:
My DataGrid is bound to DataSet which contains relationship between two tables as follows: SqlHelper.FillDataset(strConn, CommandType.StoredProcedure, "spSelectClientApplicant", ds, New String()...
1
by: Julie | last post by:
Part of my site has a search capability that I'd like to enhance. What I'd like to do is have a 'filter' of some kind that would take the search results page and would highlight the found words,...
8
by: Ben Fidge | last post by:
Hi I'm working on a site which requires the users to specify a hotel at which they're staying in London. The complete list of hotels comes to something like 1600 records. Each record consists of...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
7
by: Dave Hammond | last post by:
Hi All, I'd like to have indexed search capability on column A, column B, or columns (A,B) for a given table. According to the MySQL manual, a multi-column index of (A,B) will provide "leftmost...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
0
by: passion | last post by:
"Specialized Search Engines" along with Google Search Capability (2 in 1): http://specialized-search-engines.blogspot.com/ Billions of websites are available on the web and plenty of extremely...
1
by: sherifffruitfly | last post by:
Hi all, I'm tasked with adding a few fields to our database, and all of the stuff that goes along with it (updating c# UI code, etc.). The database is a few hundred tables, with all of the...
1
by: Luqman | last post by:
I am using VS 2008, and I am looking for some code which puts live search capability to GridView or ListView 3.5. Just like Yahoo search engine text box, you start typing anything in textbox and it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.