I have a SQL command to display some recoreds in a GridView.
The view is filtered on the SQL command below:
SelectCommand="SELECT * FROM [ProductIncluded] WHERE ([GFMerchantProductName] LIKE '%' + @GFProductName2 + '%')">
Which works well when I populate @GFProductName2 with a value, however I would like to show all records if the @GFProductName2 is left blank, whereas it returns no records. How would I do this in the same SQL statement rather than a new SQLcommand for when @GFProductName2 is left blank.