ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem
ReportViewer with SQLite Problem ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
Go Back  Xtreme Visual Basic Talk > > > ReportViewer with SQLite Problem


Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2015, 08:23 PM
gpraceman's Avatar
gpracemanReportViewer with SQLite Problem gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default Problem filling DataTable from SQLite database


I have a desktop app using WinForms and am adding support for SQLite data files to it. I can connect to the data file and pull up data in the forms no problem, but I run into a "The 'System.Data.SQLite' provider is not registered on the local machine." error when trying to pull up a report with ReportViewer 2010.

I've done a bit of searching around and have added the following entry to my app.config file, but still get the error.

Code:
    <system.data>
      <DbProviderFactories>
        <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite"
             type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.97.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
      </DbProviderFactories>
    </system.data>
The System.Data.SQLite.dll file is copied to the local app folder.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.

Last edited by gpraceman; 08-11-2015 at 02:22 PM. Reason: Clarifying the thread title
Reply With Quote
  #2  
Old 08-11-2015, 06:59 AM
PlausiblyDamp's Avatar
PlausiblyDampReportViewer with SQLite Problem PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,052
Default

Not tried this and have no idea if it works but have you tried installing the .dll into the GAC?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags

Last edited by PlausiblyDamp; 08-11-2015 at 12:59 PM.
Reply With Quote
  #3  
Old 08-11-2015, 10:28 AM
gpraceman's Avatar
gpracemanReportViewer with SQLite Problem gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

In the docs for SQLite it says "Installing the assemblies into the Global Assembly Cache is not recommended as it may cause conflicts with other applications installed on the machine."
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #4  
Old 08-11-2015, 01:00 PM
PlausiblyDamp's Avatar
PlausiblyDampReportViewer with SQLite Problem PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,052
Default

Fair enough

You might want to try changing the type attribute to
Code:
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"
Removing the public key, language and version parts of the name will eliminate any potential discrepancies.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #5  
Old 08-11-2015, 01:14 PM
gpraceman's Avatar
gpracemanReportViewer with SQLite Problem gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

Quote:
Originally Posted by PlausiblyDamp View Post
Fair enough

You might want to try changing the type attribute to
Code:
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"
Removing the public key, language and version parts of the name will eliminate any potential discrepancies.
No joy unfortunately.

Doing some more digging, it really isn't an issue with the ReportViewer. The error occurs when it tries to fill the DataTable which is sent to the report.

Below is some sample code. The error occurs when getting the data from the table adapter.

Code:
      Dim dtaTurnaroundStats As New DataSourcesTableAdapters.TurnaroundStatsTableAdapter
      Dim dt As DataSources.TurnaroundStatsDataTable

      dtaTurnaroundStats.Connection.ConnectionString = g_objDBCtrl.ConnectionString

      If objCriteria.Group.ID > 0 Then
        dt = dtaTurnaroundStats.GetDataByGroup(objCriteria.Group.Name)
      ElseIf objCriteria.Round.Number > 0 Then
        dt = dtaTurnaroundStats.GetDataByRound(objCriteria.Round.Number)
      Else
        dt = dtaTurnaroundStats.GetData
      End If
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #6  
Old 08-11-2015, 03:01 PM
gpraceman's Avatar
gpracemanReportViewer with SQLite Problem gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

I've managed to work around the issue. Instead of using the table adapters, I am loading a data table from a data reader.

Code:
      Dim objReader As IDataReader = g_objDBCtrl.ExecuteReader(sSQL)
      Dim dt As New DataTable

      dt.Load(objReader)

      objReader.Close()
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
 
ReportViewer with SQLite Problem
ReportViewer with SQLite Problem
 
-->