A simple database search
Posted on 2006-07-11
I need to do a simple search page, where a user enters in criteria via textboxes. There are 4 values that can be used by criteria, and it needs to be searchable by any or all. The search would be then run on a MS-SQL Server.
I can write the SQL easy enough, as it would be as simple as:
field1=@param1 OR field2 = @param2 OR .... field4 = @param4
My problem is in getting the values for the parameters, and then displaying the search results.
I have the 4 textboxes, and I can get their values with a simple .text, and I imagine that the best way to display the results would be with an <asp:GridView>, but how do I tell the gridview to refresh so that it displays the records which meet the criteria, once the user has pressed the search button?