How to handle ASP.NET error.

A

ABC

I write a search engine using full-text indexing under MS SQL Server. When
I typed 'and' or 'OR' as keywords, it will display as follow the error
message. How can I handle this error message. I use sqldatasource control
binding data to datagrid. I don't know where position I should add 'try
catch and finally' statement.


A clause of the query contained only ignored words.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A clause of the query
contained only ignored words.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
 
V

Vadivel Kumar

The error happening because of the ignored words
has been given as a keyword. The full-text indexing will not use these words
for searching, rather it will throw error.

The basic way to overcome this problem is, to filter out those ignored words
when in the submit button event.

Check sqlserver online help for "fulltext ignored words". You will get a
list of words and in submit button event, write some statments like this,

if(TextBox1.Text.Trim().EndsWith("or") && TextBox.Text.Trim().Length==2)
return;

Like this, you can write code for all the ignored words.

Hope, this helps.
Do post if you've further problem.

Regards
Vadivel Kumar
http://blogs.wdevs.com/varahe
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top