I have a textbox where the user will enter some SQL:
for example: SELECT * FROM Customers;
I know the LINQ will look something like this:
var query =
from c in Customers.AsEnumerable()
select c;
The problem I am having is that the user is going to enter a string, so I need to convert this string into a LINQ command:
for eg.
How will I convert "FROM
" to from --> a text to a command.
In other words I will want something like:
var query =
toCommand("from") c in Customers.AsEnumerable()
toCommand("select") c;
Forgot to mention that Customers is stored in a DataTable.
Thanks in Advance.