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

Connection strings format

5 Answers 625 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 16 Apr 2019, 07:50 AM

It seems that the report viewer only supports this connection string format in the appsettings.json file for Asp.Net Core applications

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

 

But now a days this format for connection strings is used:

"ConnectionStrings":  {
"Reports": "Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True"
}

 

It should be nice if the newer format also is supported.

 

 

 

5 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 18 Apr 2019, 03:44 PM
Hi Marcel,

We need the providerName along with the rest of the information in the connection string. Our current approach for registering the connection string is also consistent with the approach in the .NET Framework. If we use the proposed approach, we will not be able to determine the data provider.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Borja
Top achievements
Rank 1
answered on 13 May 2019, 01:52 PM

Hi Neli,

And how can we mix this way to set up the connection string with the one that Marcel posted?

If is not posible, how can we reference the connection string in the startup with that format?

I mean:

services.AddDbContext<MyContext>
                (options => options.UseSqlServer(Configuration.GetConnectionString("MyContext")));

Cant find the way to make startup work in the format that telerik reporting needs.....

Regards,

 

0
Marcel
Top achievements
Rank 1
answered on 14 May 2019, 06:33 AM
@Carlos: I created two *settings.json files. One regular appsettings.json and another one with the name reportsettings.json. Both have different formats of connectionstrings. Add the startup of the application I also add the reportsettings as a config file.
0
Borja
Top achievements
Rank 1
answered on 14 May 2019, 06:39 AM

Thank you Marcel,

Just trying it right now!

 

Regards

0
Borja
Top achievements
Rank 1
answered on 14 May 2019, 06:47 AM

Worked like a charm Marcel, 

Still thinking how i missed it. 

Have a nice day

Tags
General Discussions
Asked by
Marcel
Top achievements
Rank 1
Answers by
Neli
Telerik team
Borja
Top achievements
Rank 1
Marcel
Top achievements
Rank 1
Share this question
or