ODBC connection to snowflake works in Report Designer but fails when hosted in .Net 5 web application

1 Answer 61 Views
.NET 5 DataSource JSON DataSource SQL DataSources General Discussions Rendering Report Viewer - ASP.NET
Dhiraj
Top achievements
Rank 1
Dhiraj asked on 14 Oct 2021, 03:07 AM

Hi,

I have created a cross tab report with Snowflake ODBC as a data source and it works perfectly fine in Telerik Report Designer, when I click on preview I could see the data being fetched from my snowflake database.

I have snowflake DSN setup on my machine with name "SFDevAdmin"

But when I host it in .Net 5 as REST API and trying to render it in HTML I get connection error I think I need to specify the connection string in my asp.net application and I did it like this in my appsettings.json

 "connectionStrings": {
    "SFODBC": "Data Source=SFDevAdmin"
  }

but I am getting below error 

Could you please help me on this to make odbc connection work when hosted in asp.net 5 application 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 Oct 2021, 09:17 AM

Hello Dhiraj,

That is correct, unless you embed the connection string in the report during the SqlDataSource configuration, the connection string must also be specified in the project where the reporting service will be hosted.

Note that the way you have set up the connection string, it will use System.Data.SqlClient as data provider invariant name. In order to explicitly specify the data provider, you may define the connection string like this:

    "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString": {
      "connectionString": "Data Source=(local)\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=SSPI",
      "providerName": "System.Data.SqlClient"
    }

Also, in order to use the snowflake data provider, you must extend the list of the supported ADO.NET data providers in .NET Core registering a new DbProviderFactory instance through the Telerik.Reporting.Processing.Data.DbProviderFactories class.

For more information, please see the How to register a DbProviderFactory in a .NET Core project KB article.

If you would need further assistance, please attach a trace listener to the project and send us the generated trace log - Troubleshooting reporting implementation into ASP.NET Core application.

Thank you for trying Telerik Reporting!

Regards, 
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
.NET 5 DataSource JSON DataSource SQL DataSources General Discussions Rendering Report Viewer - ASP.NET
Asked by
Dhiraj
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or