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

Connection to ms access from a dotnetcore wpf app

2 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Guittier
Top achievements
Rank 1
Guittier asked on 03 Aug 2020, 03:27 PM

Hello,

I build a Report with the standalone ReportDesigner.

The report is connected with a Ms Access database with Microsoft.ACE.OLEDB.12.0 .The datasource is "embedded".

When i launch the preview in the designer it works fine.

 

Now I want to view the report in my WpfCore app (compile in x86 mode).

I have a error :

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.
------------- InnerException -------------
Keyword not supported: 'provider'.

 

I try differents things :

- add an appsetting.

- Changing the connection string dynamically (with the sample code in the KB, which work fine with a SqlServer connection)...

- change driver by Jet4.0 driver...

And it doesn't work...  How can I make it works ??

I know that ms access is not the best database engine but i can't change it...

2 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 06 Aug 2020, 09:48 AM

Hi Guittier,

If I understood correctly, you would like to render the report in a WPF Core application. I suspect that you use an embedded Reporting engine, and as it is running under .NET Core, you need a data provider for .NET Core. Check the How to register a DbProviderFactory in a .NET Core project KB article for details.

As an alternative, you may use the WPF Viewer with REST Service that is running under .NET.

The Standalone Report Designer is a .NET application and for that reason it recognizes correctly the data provider for the .NET Framework.

Regards,
Todor
Progress Telerik

0
Guittier
Top achievements
Rank 1
answered on 07 Aug 2020, 04:03 PM

Thanks for you reply.

My problem was with the appsetting.

I change my project to a WPF App, and it works fine by adding the connection string in the appconfig.

 

Tags
General Discussions
Asked by
Guittier
Top achievements
Rank 1
Answers by
Todor
Telerik team
Guittier
Top achievements
Rank 1
Share this question
or