Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5841023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:50:04+00:00 2026-05-22T11:50:04+00:00

I am using MSSQL and C# to write a search engine. I got a

  • 0

I am using MSSQL and C# to write a search engine. I got a bunch of stop words in the database. In my default.aspx page, I got a textbox and a search button. Users can type in a whole sentence into the textbox.

I wrote the code for searching a single keyword but not a whole sentence. This is the function in default.aspx.cs

 private void ImageSearch()
{


    if (txtSearch.Text.Trim().Equals(""))
    {
        //when types nothing
        txtSearch.Focus();
        Warning.Text = "Please enter the keyword to search";
        //display message
        return;
    }
    else
    {
        int check = Process.CheckStopWord(txtSearch.Text.Trim());
        //check if the keyword is stop word
        if (check == 0)
        {
            txtSearch.Focus();
            Warning.Text = "No stop word found";
        }
        else
        {
            txtSearch.Focus();
            Warning.Text = "Found Stop word";
        }

    }
}

and for the checkstopword function

public static int CheckStopWord(string keyword)
{
    string check = "0";
    string query = "SELECT COUNT (stopword) FROM stopwordtb WHERE [stopword] like '" + keyword + "'";
    //count how many stop word matches the keyword entered, return a string of a number
    accessDB dbaccess = new accessDB();
    DataSet ds = dbaccess.queryData(query);
    DataTable dt = ds.Tables[0];
    if (dt.Rows[0][0].ToString() == check)
    {
        return 0;
        //keyword != stop word in stopwordtb
        // begin search in image database - not implemented yet

    }
    else
    {
        return 1;
        //keyword = stop word in stopwordtb
    }

}

my problem is, what if the user type in a whole sentence?

For example, if he types in ” The tree” in the textbox, but “The” is a stop word, so I will just ignore the “the” and just search the image database for “tree”.

How can I put the sentence into variables and search each of them individually? or are there any faster way?

Hope somebody can give me some help. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:50:05+00:00Added an answer on May 22, 2026 at 11:50 am

    Before you search in the database, you may first split the sentence, and then check each word is a stop word using a loop (ex: while-loop),

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a MSSQL database and would like to create a column that only
I have issues with using the MyISAM engine in my database. It is constantly
I am using MSSQL and need to write a query to have: RESULT ------
Using MySQL syntax, how would I write a query to return the following (I
Using standard mysql functions is there a way to write a query that will
Using MSSQL 2008 and XQUERY Consider the following XML stored in a table: <ROOT>
I am using mssql and am having trouble using a subquery. The real query
I'm currently using MSSQL Server 2000 and to design tables, create and alter stored
I am using mssql and I want to make a query that returns a
I'm using MSSQL 2005 Reporting Services and in this case I need to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.