We help IT Professionals succeed at work.

passing search words from ASP.NET page to FULL TEXT Search in SQL SERVER 2000?

dkim18
dkim18 asked
on
421 Views
Last Modified: 2008-02-01
Hi,

I created FULL TEXT Catalog on SQL Server 2000 database.
I am trying to search records on several tables.
I have this textbox on asp.net page (NET 2.0).
I have a sql string of "select xx,xxx from table1 where contains(columnName, '" + textbox1.text + "')";

This is giving out exception.
I tried with one with TextBox1.Text.Trim() but still same error.
1) Do you know what I did wrong here??

2) About the Full Text Search, do you know if it is searching the whole search or search each of the tokenized words??
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I typed  China toys in the textbox and this is the error I got.

Syntax error occurred near 'toys'. Expected "" in search condition 'China toys'.
SqlException was unhandled by user code.

In my sql I just put a simple select * from table.
It returns records just find.


Top Expert 2005
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
My other question on another thread was if SQL SERVER's Full Text Search would parse the search string into single words or not??

I would think it would automaticall parse the string.
I will check into it.

Thanks.
Top Expert 2005

Commented:
If it does, I've never seen it, and I've messed with full-text quite a bit.  My experience is limited to SQL 2000 (don't know about the new version of SQL Server)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.