In this topic you will learn how to set up a Telerik Data Access project for use with Oracle database.
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.
For this tutorial, you need to create a new class library project for the model.
- Start Visual Studio, on the File menu select New, and then select Project.
- In the New Project dialog box, select Visual Basic or Visual C# as the programming language.
- In the Templates pane, select Class Library project.
- Type OracleData as the name of the project. Click OK.
- Integrate the project with the Telerik.DataAccess.Fluent NuGet package.
In the App.config file of the project, provide the connection string to the database:
<connectionStrings> <add name="OracleConnection" connectionString="data source=MYTNSORA;password=MyPassword; persist security info=True;user id=MyUser" providerName="Oracle.ManagedDataAccess.Client" /> </connectionStrings>
<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>
Create POCO classes for your persistent entities.
- Using the Fluent Mapping API create the metadatasource class where the mapping is defined. An example is available here.
- 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.