Yes, this would be possible. You would need to add multiple WHERE clause conditions, using the same pattern for each. However, when you specify the SELECT clause through the Specify a Selected Statement screen of the SqlDataSource wizard, the WHERE clause filter expressions specified are joined by ANDs. That is, if you followed the steps outlined earlier in this hour and added three filter expressions to the Title, Author, and Genre columns using the LIKE operator with a parameter value based on the titleSearch TextBox, the resulting SELECT query would be SELECT * FROM [Books] WHERE ([Title] LIKE '%' + @Title + '%') AND ([Author] LIKE '%' + @Author + '%') AND ([Genre] LIKE '%' + @Genre + '%') Note that the three conditions in the WHERE clause are joined by an AND. That means the only rows that will be returned will be those whose Title column value contains the user's search term and whose Author column value contains the user's search term and whose Genre column value contains the user's search term. What we want, though, is to have all books returned where any of those columns contain the search term. To accomplish this, you'll have to craft the SELECT statement yourself through the SqlDataSource wizard's Define Custom Statements or Stored Procedures screen. (This screen was first discussed in Hour 14.) |