Connection Postgresql to Telerik Rest Service

0 Answers 14 Views
.NET Framework DataSource SQL DataSources Report Viewer - ASP.NET
Egor
Top achievements
Rank 1
Egor asked on 10 Apr 2024, 03:46 PM

I use Telerik Reporting Rest Service from Telerik template. I have created a Postgresql source in Report Disigner but I couldnt to connection in TelerikReportRestService.

 

Im using trial version.

Dimitar
Telerik team
commented on 15 Apr 2024, 08:45 AM

The error from the third image usually suggests that the connection string is incorrect or missing, or the wrong data provider is used.

If you have created a SqlDataSource component in the report with the default options, it will create a SqlDataSource component that uses a shared connection. A "shared connection" means that the only information saved about the connection is the alias/name and at runtime, the reporting engine will try to get the connection string from the configuration of the running application.

If the application is indeed targeting .NET Framework as listed in the tags, the connection string should be put in the .config file of the project. The Npgsql data provider must also be specified otherwise the engine will use the default data provider(e.g. System.Data.SqlClient).

The following is an example of how to put the connection in the config file's XML:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="MyConnectionName"
        connectionString="CONNECTION_STRING"
        providerName="Npgsql" />
  </connectionStrings>
</configuration>

In case the connection is present and with the correct data provider specified but the error persists, please make sure that the connection string itself is in a valid format. You may refer to PostgreSQL connection strings - ConnectionStrings.com reference for examples.

It is recommended to first check that the connection is valid in a database management tool like pgAdmin - pgAdmin - PostgreSQL Tools.

I hope this will help. If you need further assistance, you may attach a trace listener to the project to get more information about the exception - How to: Create and Initialize Trace Listeners - .NET Framework | Microsoft Learn.

No answers yet. Maybe you can help?

Tags
.NET Framework DataSource SQL DataSources Report Viewer - ASP.NET
Asked by
Egor
Top achievements
Rank 1
Share this question
or