I need to write something in C# that allows users to query data in a human-readable format. So in a textarea, they would type in this:
Students.Class, name, address, classid, grade
Which would result in:
Marcus, 11B Westbury Ave. 200718, A+
What the above should do is: Look in the students DB, joining on the class table, then retrieving the name, address, classid, grade.
I have tried writing my own parsing method, splitting the string into an array and then based on the data in the array, querying the database. However, the issue that I am now having is that some users are making mistakes with the syntax:
Students, name, address, classid, grade
(Missing out the .class bit). So I have to throw try/catch methods and present the User with error messages.
The simple method above works, but I am wondering if there are any libraries out there that will take my string data and do what I am after?