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

unable to preview report when using ObjectDataSource

1 Answer 38 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Oumaima
Top achievements
Rank 1
Oumaima asked on 24 Jun 2020, 11:15 PM
When using an ObjectDataSource in the standalone report designer I am unable to preview the report. When I click the preview button I get an error that reads:

"An error occurred while invoking data retrieval method.
Exception has been thrown by the target of an invocation.
Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.1, Culture=neutral, PublicKeyToken=' or one of its dependencies. The system cannot find the file specified.."

1 Answer, 1 is accepted

Sort by
0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 29 Jun 2020, 02:17 PM

Hi Oumaima,

Just a heads up, this is a duplicate to support ticket 1473722. However, to help anyone in the community experiencing the same error I will post the resolution here as well. 

From the error, the report uses an ObjectDataSource that references the System.Data.SqlClient assembly. This assembly needs to be in the folder of the report designer so that the referring assembly can find it when executing the ObjectDataSource logic.

If other external assemblies are used by the ObjectDataSource assembly, they also need to be added in the designer folder. More information is available in the Extending Report Designer article.

For reference, the System.Data.SqlClient is an assembly that is distributed with a NuGet package. Ensure the exact version of the assembly from the package is used and copy it to the designer folder. This is also required for the other external dependencies of the ObjectDataSource assembly.

Lastly, at this time, the Standalone designer can resolve only assemblies built with the .NET Framework or .NET Standard 2.0. The designer is a .NET Framework Windows Forms application and cannot resolve .NET Core and .NET Standard 2.1+ assemblies. See the .NET Standard Support article for more details.

Please let me know if you need any additional information. Thank you for using the Reporting Forums.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Report Designer (standalone)
Asked by
Oumaima
Top achievements
Rank 1
Answers by
Eric R | Senior Technical Support Engineer
Telerik team
Share this question
or