Data Access has been discontinued. Please refer to this page for more information.

How to: Create a New Model

In this topic you will learn how to set up a Telerik Data Access project for use with Oracle database.

Installing the Oracle ODP.NET Driver

Telerik Data Access uses the ADO.NET (Oracle.DataAcces.Client) Provider from Oracle called ODP.NET and the ODP.NET Managed driver. In order to create a new model based on a Oracle database, you have to install either the ODP.NET Driver from Oracle, or ODP.NET Oracle, Managed Driver. You can download it from here.

Creating a New Empty model

For this tutorial, you need to create a new class library project for the model.

  1. Start Visual Studio, on the File menu select New, and then select Project.
  2. In the New Project dialog box, select Visual Basic or Visual C# as the programming language.
  3. In the Templates pane, select Class Library project.
  4. Type OracleData as the name of the project. Click OK.
  5. Integrate the project with the Telerik.DataAccess.Fluent NuGet package.
  6. In the App.config file of the project, provide the connection string to the database:

    With TNSNAMES.ORA

    <connectionStrings>
        <add name="OracleConnection" 
             connectionString="data source=MYTNSORA;password=MyPassword;
                               persist security info=True;user id=MyUser"
             providerName="Oracle.ManagedDataAccess.Client" />
    </connectionStrings>
    

    Without TNSNAMES.ORA

    <connectionStrings>
        <add name="OracleConnection" 
             connectionString="SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
                               (HOST=MyHost)(PORT=MyPort))
                               (CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));
                               uid=myUsername;pwd=myPassword;
                               persist security info=True"
             providerName="Oracle.ManagedDataAccess.Client" />
    </connectionStrings>
    
  7. Create POCO classes for your persistent entities.

  8. Using the Fluent Mapping API create the metadatasource class where the mapping is defined. An example is available here.
  9. Create your context class.

At this point you cat test the model through any application that is integrated with the Telerik.DataAccess.Core NuGet package.