Hi guys
Got a question for querying a database where the table/fields to query is not known during design/compile time, but dynamic.
Let's do an example:
Small Web form, where Joe User has got 3 Text Fields, one for Table, one for Column, and one for ID.
Joe User types in:
"Order", "Quantity", 12
This would retrieve row with ID 12 from the Orders Table, and would display Field "Quantity".
How would I solve this in actual code, when the only things I get is 3 parameters (Table, Column, ID)?
How do I translate this to
OrderEntity order = new OrderEntity(12);
adapter.FetchEntity(order);
Console.WriteLine(order.Quantity);
dynamically, without Switching trough all the possibilities?
i.e.
switch (Table)
{
case "Order":
tableEntity = OrderEntity;
break;
[.....]
}
Is there something like "Eval" I could use?
(C# 2.0, LLBLGEN 2.6, Adapter)
Haven't found a way of doing it yet
Cheers
Michel