Nothing is showing up when I try this SQL Query: "SELECT Title, Author, Course, Section, ISBN FROM dbo.Table1 WHERE Title Like '%' + @value + '%'". Any suggestions? It works when I take everything after Table1 out.
Perhaps you are not getting a @value passed and so it is looking for a single character or breaking.
I'm just using the preview data thing in Visual Studio so I'm sure it's getting the right input. When I change Title to Section and search, for example, for S16 it works fine. It's just not working with the longer entries in the table for some reason.
In an effort to troubleshoot I would suggest trying to pull an "any" list back from title and attempt to narrow it down to your "like" statement.
I'm thinking it might be something to do with the database entries at this point
Can you output to the console what the entire query string is after @value is dropped in, and then paste that in here?
It just returns nothing. When I use the Query builder in Visual Studio it works, but not when I try to preview it or use it in the application, it's weird. It only works with the exact search and not the wildcards. I don't know how to output to the console.
Ya it just seems like the wildcards aren't working properly
Figured it out lol, I just didn't have the return a datatable button checked. I feel pretty stupid now, I was trying to figure it for a good few hours
don't worry not only you make such mistakes :P
Join our real-time social learning platform and learn together with your friends!