Our users have the ability to connect to different databases via our WinForm application, thus the connection strings are not stored in the config file. How do we override the connection that gets used by OpenAccess?
2 Answers, 1 is accepted
0
Alexander
Telerik team
answered on 13 Jan 2012, 10:12 AM
Hello Scott,
You can use one of the constructors of the generated context class which has a connection parameter. The value can be either a connection name, pointing to a connection string in the configuration file, or the whole connection string. So all you need to do is get the connection string from the used and pass it to the constructor of the context.
Hope that helps.
Kind regards,
Alexander
the Telerik team
SP1 for Q3’11 of Telerik OpenAccess ORM is available for download.