Connection strings format

6 posts, 0 answers
  1. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 16 Apr Link to this post

    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.

     

     

     

  2. Neli
    Admin
    Neli avatar
    121 posts

    Posted 18 Apr Link to this post

    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
  3. Carlos
    Carlos avatar
    11 posts
    Member since:
    Jan 2015

    Posted 13 May in reply to Neli Link to this post

    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,

     

  4. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 14 May in reply to Carlos Link to this post

    @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.
  5. Carlos
    Carlos avatar
    11 posts
    Member since:
    Jan 2015

    Posted 14 May in reply to Marcel Link to this post

    Thank you Marcel,

    Just trying it right now!

     

    Regards

  6. Carlos
    Carlos avatar
    11 posts
    Member since:
    Jan 2015

    Posted 14 May Link to this post

    Worked like a charm Marcel, 

    Still thinking how i missed it. 

    Have a nice day

Back to Top