This is a migrated thread and some comments may be shown as answers.

Connection string in Asp.Net Core

3 Answers 690 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 15 Apr 2019, 12:41 PM

I have an Angular / Asp.Net Core web application. The report viewer component is working in the Angular application. Parameters are passed correctly. But when the report is loaded I get the error message in the viewer:

An error has occurred while processing Table 'crosstab1': Invalid key value.

The passed parameters values are displayed in textboxes so the report is loaded and rendered.

I guess it has something to do with the connection string that cannot be found.I created the report in the Report Designer application (so no class library/project which contains the reports) and the name of the connection string is "Reports" in the designer.

In the appsettings.json file I added an entry into the ConnectionStrings section with the name "Reports" (just as in the examples)

"ConnectionStrings": [
{"name": "Reports",     "connectionString": "Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True",     "providerName": "System.Data.SqlClient"   }
]

 

I also created an app.config file with the connection strings

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 
  <!-- To customize the asp.net core module uncomment and edit the following section.
  <!--
  <system.webServer>
    <handlers>
      <remove name="aspNetCore"/>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
  -->
 
  <connectionStrings>
    <add name="Reports"
        connectionString="Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True"
        providerName="System.Data.SqlClient" />
  </connectionStrings>
 
</configuration>

 

It seems that the Report Engine cannot find the connection string. Or does the Report Engine use another name for finding the connection string?

3 Answers, 1 is accepted

Sort by
0
Marcel
Top achievements
Rank 1
answered on 15 Apr 2019, 04:55 PM

Connection string seams not be the problem because I added a normal table which display's data. The problem is the cross table which works fine in the designer but not in the report viewer.

0
Marcel
Top achievements
Rank 1
answered on 16 Apr 2019, 07:50 AM
This thread can be closed. Problem is the format of the connection string in the config files. See https://www.telerik.com/forums/connection-strings-format
0
Marcel
Top achievements
Rank 1
answered on 16 Apr 2019, 07:51 AM
This thread can be closed. Problem is the format of the connection string section in the config files. See https://www.telerik.com/forums/connection-strings-format
Tags
General Discussions
Asked by
Marcel
Top achievements
Rank 1
Answers by
Marcel
Top achievements
Rank 1
Share this question
or