I would like to select from a table using linq to sql without knowing what that table is until runtime, something like
Type t = Type.GetType(myString);
var results = from o in context.t select o;
Obviously this doesn’t work, but I was wondering if there was a way to do this.
Well, you can use
DataContext.GetTable(Type). That returns anITable. Without knowing more about what you’re trying to do, that’s the closest we can really come to answering… if you can give more detail, we may be able to help you more.