none
ReportViewer display Nothing after change of application ConnectionString programmatically RRS feed

  • Question

  • In my VB.Net (VS 2010) application, there are multiple companies which have own database file (MS Access), but same dataset and schema.

    I changed applications' connectionstring like this;

    My.Setting("ConnectionString1")="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\CompanyB.mdb;Persist Security Info=True;Jet OLEDB:Database Password=Password"

    Application Forms are displaying based on New DB file- DataSets are same for each DB, just name is different.

    But reportviewer controls display nothing.

    Do I need to provide new connectionString in other way for ReportViewer?

    Actually the reports are based on separated dataset combining data from few tables of the original dataset generated for the application.

    I examined TableAdapter of ReportViewer forms. And found that only with setting ConnectionString of CompanyB MDB file (copy of CompanyA), display nothing in preview, while with CompanyA.mdb, there is no problem in preview.


    • Edited by PowerCPA Friday, September 27, 2019 1:31 AM
    Wednesday, September 25, 2019 11:04 PM

Answers

  • I solved the problem.

    I copied Orignal MDB file (CompanyA.mdb) and changed the name to CompanyB, the counterfeit of the Original.

    Even though I check the schemas from each MDB files (CompanyA and CompanyB),these were identical.

    I do not know what was the exact problem...


    • Marked as answer by PowerCPA Friday, September 27, 2019 5:43 AM
    • Edited by PowerCPA Saturday, September 28, 2019 7:06 AM
    Friday, September 27, 2019 5:43 AM