Reading from dynamically created tables with LINQ

We create tables in runtime. They have the same schema layout as tables that exist in our DBML but with an alternate name. We want to set the table names in runtime in our use of Linq to Sql.

Using wrapper classes on the Metadata as outlined in https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=4233721&SiteID=1 works great for the updates, deletes and inserts.

Does anyone know how we can get the read of the alternate table to work?

Answers


You need to use an external mapping file. Populate the xml with the names of your table at runtime. This over-rides the attribute based mapping.


You need to new up your LINQ expression at run-time via System.Linq.Expressions


Need Your Help

Google Charts API Line Chart - How do I display multiple values when hovering?

javascript charts google-visualization linechart

When using google's line chart, if you hover over a point it gives you the information about that point. For example, if a point is at x:3, y:50 and the y-axis is called inches, hovering over the p...