Change Schema Name at Runtime
Posted: Thu 08 Dec 2016 17:56
Some of my tables in my model are contained in schema that may not be named the same when pulling from other databases (and my DBA refuses to change it). All of the tables are present but I may need to access it through SCHEMA1.TABLE vs SCHEMA2.TABLE.
Right now in the auto generated code behind there is a custom attribute for each table containing SCHEMA.TABLE. For instance
For one DB FMC_TP is fine but another it may be FMC_DEV.
Is there a way to modify this at runtime possibly by adding a setting to the app.config file?
Right now in the auto generated code behind there is a custom attribute for each table containing SCHEMA.TABLE. For instance
Code: Select all
[Table(Name = @"FMC_TP.EQUIPMENT")]
For one DB FMC_TP is fine but another it may be FMC_DEV.
Is there a way to modify this at runtime possibly by adding a setting to the app.config file?