following exception occured in .net core api:
Telerik.Reporting.Processing.Data.SqlDataSourceException: Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application. ---> System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at Telerik.Reporting.Processing.Data.SqlCommandProvider.CreateConnection(String connectionString)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateConnection()
"Telerik.Reporting.Processing.Data.SqlDataSourceException: Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
---> System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at Telerik.Reporting.Processing.Data.SqlCommandProvider.CreateConnection(String connectionString)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateConnection()
--- End of inner exception stack trace ---
at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateConnection()
at Telerik.Reporting.Processing.Data.SqlDataEnumerable.GetEnumerator()+MoveNext()
at Telerik.Reporting.Processing.Data.LazyList`1.LazyListEnumerator.MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at Telerik.Reporting.Processing.Data.SeedDataAdapter.Execute(IEnumerable`1 data)
at Telerik.Reporting.Processing.Data.ResultSetAdapter.Execute(IEnumerable`1 data)
at Telerik.Reporting.Processing.Data.MultidimentionalDataProvider.Execute(MultidimensionalQuery query)
at Telerik.Reporting.Processing.DataItemResolveDataAlgorithm.GetDataCore(IDataSource dataSource, MultidimensionalQuery query, IServiceProvider serviceProvider, EvalObject expressionContext, IProcessingContext processingContext)
at Telerik.Reporting.Processing.DataItem.GetDataCore(IDataSource dataSource, MultidimensionalQuery query)
at Telerik.Reporting.Processing.DataItemResolveDataAlgorithm.ResolveData(String processingId, InMemoryState inMemoryState, MultidimensionalQuery query, Func`1 getDataCore, EvalObject expressionContext)
at Telerik.Reporting.Processing.DataItem.ResolveData()
at Telerik.Reporting.Processing.DataItem.ProcessItem()
at Telerik.Reporting.Processing.Table.ProcessItem()
at Telerik.Reporting.Processing.ReportItemBase.ProcessElement()
at Telerik.Reporting.Processing.ProcessingElement.Process(IDataMember dataContext)"
can any one help
Hello Mugunthan,
Could you please provide more information on how you are adding the connection strings to SqlDataSource components? If you are using shared connections with aliases, you may need to configure them in your configuration file so that they can be picked up during the processing of the report. For instance, if you are using a JSON configuration, this can be done as follows:
{ "ConnectionStrings": { "AdventureWorksDBAlias": { "connectionString": "Data Source=(local)\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=SSPI", "providerName": "System.Data.SqlClient" } }, }
If you are rendering the report through a report processor, you may need to pass the configuration with the connection strings to it through the constructor as follows:
IConfiguration configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .Build(); var reportProcessor = new ReportProcessor(configuration);
If the above suggestion did not resolve your issue, please provide a sample TRDP file that includes an SqlDataSource and causes the issue when trying to render. Additionally, it would be helpful to share more details about your environment, including whether you are attempting to render the report using a report viewer or report processor. Thank you!