I am getting the error in the title when trying to do a simple search from a textbox through an SqlDataSource output to a gridview. If I search for 123 it returns the record with ID 123, as it should. If I search for aaa it returns the error. Anyone have any idea why??? The database looks like so:
id int (primary key / identity)
struser nvarchar(50)
The SQL statement looks like this:
SELECT id, struser
FROM ticket
WHERE (id = @id) OR (struser = @struser)
Try