2

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?

2 Answers 2

1

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.