tags:

views:

101

answers:

5

I am a noob in ASP.NET and building a website currently... I want the site to have a search feature.. How can I add this to my site? Is there a good tutorial out there ?

+3  A: 

Why not use Google, of course! This is the website standard for searching. : )

http://www.google.com/cse/

If you mean that you want to search your database and not your website, then usually people do a SQL query with some kind of result display - gridview (fast & easy!), or repeater.

rlb.usa
You can also enable full text searching within the database
James Westgate
+1  A: 

How to Implement Search Features in ASP.NET ?

Good SO Question related to the topic.

Rachel
+2  A: 

Well, to have a search function you first need something to search in (database, hash table, heap, etc.). I assume that in this case you'll be using a database.

For a basic search function to search for a string in, say, a table of articles you could just use the following SQL statement:

SELECT * FROM `Articles` WHERE `Text` LIKE '%<search string here>%'

The '%' character is the SQL wildcard, so will match the search string wherever it's found: %hell% will match "Hello world" and "shell", etc.

That's a pretty crude way of doing it, so search around for some articles on the subject and you should be able to find some more sophisticated methods.

Moonshield
A: 

different ways to do it

1 : Dynamic data search within your application- You will have a search page and when user submits a search query, you will build a SELECT query using that and search in apppropriate tables ans show the results from the datasource returned from executing your select query

2 : Static page search - If you have a lot of static pages in your website,you can use this.You need to enable IIS indexing .you have to create a catalog for your site.IIS will do the rest.You need to use the code to read result from IIS index.(The code is not so big.Only few lines.Get it from google)

3 : Add Google search : You can add the google search widget to your website

Shyju
A: 

Try this: Asp net with .net LUCENE or this : Also with dotnet lucene

Florim Maxhuni