Hi

I have a feeling this is not possible but I thought I should ask in
any case.

Is it possible to use DBLinq/Linq to query a table dynamically.
Something like: -

string tableName = "my_table";
var q = from p in db.GetTableX(tableName) select p;

I have used GetTableX here as the existing methods GetTable doesn't
allow you to do this.

I have several tables that all have an ID column and I would select a
row that has a particular ID.

I have tried several methods including instantiating a generic
instance using Activator.CreateInstance and invoking a CreateQuery as
a GenericMethod. Unfortunately both methods just return an Object
which cannot be  enumerated with Linq's select construct.

I can see why this is tricky since the "<from> * <in> * <where> *
<select>" grammar needs strong typing.

Thanks in advance,
Blair
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to