Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / OpenAccess ORM > General Discussions > Change Connection String used, not stored in config file

Not answered Change Connection String used, not stored in config file

Feed from this thread
  • Scott avatar

    Posted on Jan 11, 2012 (permalink)

    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?

    Reply

  • Alexander Alexander admin's avatar

    Posted on Jan 13, 2012 (permalink)

    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

    Reply

  • Scott avatar

    Posted on Jan 13, 2012 (permalink)

    Yes, that worked perfectly. Thanks!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / OpenAccess ORM > General Discussions > Change Connection String used, not stored in config file
Related resources for "Change Connection String used, not stored in config file"

OpenAccess ORM Features  |  Documentation  |  Demos  |  Telerik TV  |  Step-by-step Tutorial   ]