Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
How to: Define the Connection String (Manually)
Programmer's Guide > OpenAccess ORM Classic (Old API) > OpenAccess Tasks > Connections and Data Store Management > How to: Define the Connection String (Manually)

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

This topic shows how to define the connection settings that are used when connecting to a Telerik OpenAccess ORM data model. This topic is based on the Northwind and MS SQL Server Express edition. This topic assumes that you have already configured Telerik OpenAccess ORM model project and defined the Northwind Model. The sample model in C# can be found here.

If you use the Telerik OpenAccess ORM Enable Project Wizard in a Visual Studio project, it automatically generates the project settings required. For more information, see How to: Use the Enable Project Wizard.

Defining the connection string manually

Open the project's application configuration file (App.config or web.config) and add the following connection string:

XML Copy Code
<add name="DatabaseConnection1" connectionString="data source=(local)\SQLEXPRESS;initial catalog=Northwind;integrated security=True" providerName="System.Data.SqlClient" />

You will have to add also a corresponding backend connection node in the Data Model project’s .config file, which is required by the Telerik OpenAccess ORM runtime:

XML Copy Code
 <openaccess xmlns="">
   <references />
<connection id="DatabaseConnection1">
<connectionString>Data Source=(local)\SQLEXPRESS;Initial Catalog=InheritanceInterface;Integrated Security=True</connectionString>
<backendconfiguration id="mssqlConfiguration" backend="mssql">
<mappings current="mssqlMapping">
<mapping id="mssqlMapping">


Both the backend connection node id and the connection string Name attribute should contain the same value – that way Telerik OpenAccess ORM runtime can resolve the dependency and use both to establish successfully a database connection.


If your project does not have an application configuration file, you can add one by selecting Add New Item from the Project menu, selecting the General category, selecting Application Configuration File, and then clicking Add.