My standard Grid View display, or LINQ display, of my primary database is just how I want it, but I want to be able to make it display different sets of records based on parameters passed to it from a 'calling' page.
SELECT [ID], [Title], [Series_Available], [Available], [Authors_UK], [Illustrators_UK], [Authors_USA], [Illustrators_USA], [Book_Numbers], [ISBNs], [Publication_Dates], [Front_Cover_JPEGs] FROM [Titles]
what I want to be able to then do is have the system generate a varying WHERE clause based on the two parameters of field to test, and value to test, so that for example on one call it might generate
WHERE Available 'contains' "A"
BUT on another occasion it might be called on to generate
WHERE Authors_UK 'contains' "Notkin"
The contents of Available is an up to 16 character string with one, some or all of the letters A to P, each letter occuring, if at all, only once.
The contents of Authors_UK is a string such as "Gulkin, S; Notkin, J. J."
Bottom line questions -
1. Is there a 'contains' operator, or a function that can be called to do that? If it is a function, how would I incorporate that call to the building of the WHERE clause?
2. Can I pass a field name as a parameter and, if so, how do I do it?
If these questions are beyond the scope of the Beginning book and more the scope of the Professional book, I am very happy to buy that book, and look to find the answers there, or on the forum for that book. Please advise accordingly.