I'm having some issue connecting to a database. I'm using a Microsoft Access db and the standalone report designer. However, it is a requirement that I overwrite the data source's database connection programatically so that it is always using my WPF application's database ConnectionString in the app.config. Using the standalone report designer is required because the client will be creating new reports and then previewing them, but ultimately dropping the report files on many machines which may have different db paths.
What DOES work is if embed my db connection in the report designer wizard - then the report will successfully show up in my application. However, this doesn't solve my issue of needing to use the app.config connection string.
My connection string looks like so:
My code to change the datasource:
>var reportSource = new UriReportSource();<
> reportSource.Uri = @"Reports/MyReport.trdp";</
> var reportInstance = UnpackageReport(@"Reports/MyReport.trdp");<
> var dataSource = new SqlDataSource(); <
> dataSource.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;<
> dataSource.ProviderName = "Microsoft.Jet.OLEDB.4.0";<
> reportInstance.DataSource = dataSource;<
>// Creates an InstanceReportSource<
> var instanceReportSource = CreateInstanceReportSource(reportInstance, reportSource);<
> this.ReportViewer1.ReportSource = instanceReportSource; </
I get the error "Unable to find the required .Net Framework provider. It may not be installed."
How can this be true if I can otherwise access the same database using that connection string elsewhere in the application? And the embedded connection string will work correctly?
I'm hitting a wall here. I have seen other threads mention downloading the newest JET service pack but even Microsoft's support site says I should already have it (https://support.microsoft.com/en-us/kb/239114). I am on a 64 bit Windows 8 machine, and have my solution compiling to a 32 bit application.
Any help would be appreciated. Thank you!!