• pwalter83 (1/31/2013)

    However, when I view the result in a browser, it displays all the data from the table in the gridview and doesnt filter out based on the values from the 2 dropdown boxes. I think somewhere there is a link missing between the click event code of the button and the gridview. Because when I run the query in SQL, it works correctly and displays filtered data.

    Is it possible that your current version isn't building properly, and you are running an older version of the code? If a solution doesn't build, VS will ask you if you want to run the last buildable version; you can answer Yes and opt to not be shown that warning again. This might explain why it does not appear to be processing your WHERE clause correctly.

    To be honest, the code behind your click event looks right to me. You could replace the references to @Value1/2 with hard-coded values to see if that returns the desired results; if it does, then something's wrong with the way you're populating the parameter values (though it seems to me that would result in 0 rows returned, not All).