SqlTypeProvider error while accessing SQLITE database

I am accessing a SQLite database through SQLProvider . I can actually connect to the database and query the data in the table. However, the supplier indicates the type of error: Exception has been thrown by a target of an invocation. And intellisense really doesn't work, for example. tables or properties are not displayed. See screenshot:

Type Provider Error

Since tables and types seem to be unavailable, VS shows an error lookup on object of indeterminate typewhen trying to access properties (it works, though). Extracting data from tables also works. Thus, a type provider can access the database, but shows these errors. Is there a way to get it to correctly recognize db and access its properties, etc. No mistakes.

I am using the 64-bit SQLite driver. Here is the code:

#if INTERACTIVE
#r @"..\packages\SQLProvider.1.0.8\lib\FSharp.Data.SqlProvider.dll" 
#r @"..\packages\System.Data.SQLite.Core.1.0.101.0\lib\net46\System.Data.SQLite.dll"
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Data.Linq.dll"
#endif

open System
open FSharp.Data.Sql

[<Literal>]
let connectionString = "Data Source="+ @"C:\tmp\databaseFile.db3"
[<Literal>]
let resolutionPath = __SOURCE_DIRECTORY__ + @"..\..\packages\System.Data.SQLite.Core.1.0.101.0\lib\net46"

type sql = SqlDataProvider<
                Common.DatabaseProviderTypes.SQLITE, 
                ConnectionString = connectionString, 
                ResolutionPath = resolutionPath, 
                CaseSensitivityChange = Common.CaseSensitivityChange.ORIGINAL
                >

let ctx = sql.GetDataContext()

let table2 = ctx.Main.Table2   //DateTime
let table3 = ctx.Main.Table3   //Text

query {                                         
        for r in table3 do
            select (r.Date1)                                
            } |> Seq.toList

query {                                         
        for r in table2 do
            select (r.Date1)                                
            } |> Seq.toList
+4
1

- SQLite SQLTypeProvider (1.0.102.0 1.0.31 ):

#if INTERACTIVE
#I @"..\packages\SQLProvider.1.0.31\lib"
#r "FSharp.Data.SqlProvider.dll" 
#I @"..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46"
#r "System.Data.SQLite.dll"
#I @"..\packages\System.Data.SQLite.Linq.1.0.102.0\lib\net46"
#r "System.Data.SQLite.Linq.dll"
#endif

open System
open FSharp.Data.Sql
//open System.Data.SQLite
//open System.Data.SQLite.Linq

[<Literal>]
let connectionString = "Data Source="+ @"C:\tmp\databaseFile.db3"
[<Literal>]
let resolutionPath = __SOURCE_DIRECTORY__ + @"..\..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46"

type sql = SqlDataProvider<
                Common.DatabaseProviderTypes.SQLITE, 
                connectionString, 
                ResolutionPath = resolutionPath, 
                CaseSensitivityChange = Common.CaseSensitivityChange.ORIGINAL>

let ctx = sql.GetDataContext() 

let table2 = ctx.Main.Table2   //DateTime
let table3 = ctx.Main.Table3   //Text

, - № 196.

+2

All Articles