Click here to Skip to main content
15,904,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am new to .NET. Please help.
I need to create a search functionality using TextBox and Button controls.

When I enter keyword in TextBox and click Button, so it will show me --Item # and Item Description on same page.
I am using Sql Server database,which have one table from where Item # and Description will show.
Then I need when I click on the search results whether Item # or Item Description, their values will be populate in GridView.
Posted
Updated 19-Nov-10 13:56pm
v4
Comments
Dave Kreskowiak 19-Nov-10 17:03pm    
OK, what's the question? Which part of this entire process are you having a problem with?
Dalek Dave 19-Nov-10 19:56pm    
Edited for Readability and Grammar.

If the item to be searched for is the Primary Key you can use the DataTable.Find()[^] method.

Otherwise use a BindingSource and the BindingSource.Find()[^] method.

Alternatively, if you are using a BindingSource, there is the BindingSource.Filter[^] property, which may be better for cases where there is more than one match.
 
Share this answer
 
First, How to get search result on page on button click.
Second, How to populate results in grid.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900