Jump to content
Howto: Add A Search Button To The Contact Project In Chapter 1
4 replies to this topic
Posted 03 September 2010 - 11:41 AM
(NOTE: This applies only to the second edition of Head First C#)
A while back, one of our readers posted a question about adding a search button to the project in chapter 1. I've gotten that question a few times, and while we don't cover it in the book, I thought it was worth coming up with an answer. And luckily, the instructions in that post still work for the second edition, even though we switched from SQL Server Express to SQL Server Compact Edition.
So here are step-by-step instructions for adding a button to your form to filter the results based on search criteria. It does this by setting the RowFilter for the dataset that holds the data retrieved from the database, and then updating the binding source's DataSource to tell it to reload the data from the dataset.
Note that this is a "quick and dirty" solution, but it should work just fine for a straightforward application.
Author, Head First C#
Building Better Software -- http://www.stellman-greene.com
Posted 10 June 2011 - 11:54 AM
Is there a way to use the search text box with an autocomplete functionality (querying from the Name's table)?
Posted 11 July 2011 - 02:15 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users