Connect to Oracle Eloqua Reporting Data from PowerBuilder via ADO.NET

Jerod Johnson
Jerod Johnson
Senior Technology Evangelist
This article demonstrates how to access Oracle Eloqua Reporting data from Appeon PowerBuilder using the CData ADO.NET Provider for Oracle Eloqua Reporting.

This article demonstrates using the CData ADO.NET Provider for Oracle Eloqua Reporting in PowerBuilder, showcasing the ease of use and compatibility of these standards-based controls across various platforms and development technologies that support Microsoft .NET, including Appeon PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData ADO.NET Provider for Oracle Eloqua Reporting to retrieve data.

  1. In a new WPF Window Application solution, add all the Visual Controls needed for the connection properties. Below is a typical connection string:

    AuthScheme=Basic;User=user;Password=password;Company=MyCompany;

    Oracle Eloqua Reporting supports the following authentication methods:

    • Basic authentication (User and Password)
    • OAuth 2.0 code grant flow
    • OAuth 2.0 password grant flow

    Basic Authentication (User and Password)

    To perform authentication with a user and password, specify these properties:

    • AuthScheme: Basic.
    • Company: The company name associated with your Oracle Eloqua Reporting account.
    • User: Your login account name.
    • Password: Your login password.

    OAuth Authentication (Code Grant Flow)

    To authenticate with the OAuth code grant flow, you must set AuthScheme to OAuth and create a custom OAuth application. For information about how to create a custom OAuth application, see the Help documentation.

    Then set the following properties:

    • InitiateOAuth: GETANDREFRESH. Used to automatically get and refresh the OAuthAccessToken.
    • OAuthClientId: The client Id assigned when you registered your application.
    • OAuthClientSecret: The client secret that was assigned when you registered your application.
    • CallbackURL: The redirect URI that was defined when you registered your application.

    When you connect, the driver opens Oracle Eloqua Reporting's OAuth endpoint in your default browser. Log in and grant permissions to the application. When the access token expires, the driver refreshes it automatically.

    OAuth Authentication (Password Grant Flow)

    With the OAuth password grant flow, you can use your OAuth application's credentials alongside your user credentials to authenticate without the need to grant permission manually via a browser prompt. You must create an OAuth app (see the Help documentation) to use this authentication method.

    Set the following properties:

    • AuthScheme: OAuthPassword
    • Company: The company's unique identifier.
    • User: Your login account name.
    • Password: Your login password.
    • OAuthClientId: The client Id assigned when you registered your custom OAuth application.
    • OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.
  2. Add the DataGrid control from the .NET controls.
  3. Configure the columns of the DataGrid control. Below are several columns from the Account table:
    
    <DataGrid AutoGenerateColumns="False" Margin="13,249,12,14" Name="datagrid1" TabIndex="70" ItemsSource="{Binding}">
    <DataGrid.Columns>
        <DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" />
        <DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=}" Header="" Width="SizeToHeader" />
    		...
    	</DataGrid.Columns>
    </DataGrid>
    
  4. Add a reference to the CData ADO.NET Provider for Oracle Eloqua Reporting assembly.

Connect the DataGrid

Once the visual elements have been configured, you can use standard ADO.NET objects like Connection, Command, and DataAdapter to populate a DataTable with the results of an SQL query:

System.Data.CData.OracleEloquaReporting.OracleEloquaReportingConnection conn 
conn = create System.Data.CData.OracleEloquaReporting.OracleEloquaReportingConnection(connectionString)

System.Data.CData.OracleEloquaReporting.OracleEloquaReportingCommand comm 
comm = create System.Data.CData.OracleEloquaReporting.OracleEloquaReportingCommand(command, conn)

System.Data.DataTable table
table = create System.Data.DataTable

System.Data.CData.OracleEloquaReporting.OracleEloquaReportingDataAdapter dataAdapter
dataAdapter = create System.Data.CData.OracleEloquaReporting.OracleEloquaReportingDataAdapter(comm)
dataAdapter.Fill(table)	
datagrid1.ItemsSource=table.DefaultView

The code above can be used to bind data from the specified query to the DataGrid.

Ready to get started?

Download a free trial of the Oracle Eloqua Reporting Data Provider to get started:

 Download Now

Learn more:

Oracle Eloqua Reporting Icon Oracle Eloqua Reporting ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Oracle Eloqua Reporting.