F # SqlDataConnection TypeProvider not working with Sql Server Ce

I play with new providers like F # in VS 11 Beta in Win 8 CP, and I cannot convince a provider like SqlDataConenction to work with the SqlCe database. The code:

open System open System.Data open System.Data.Linq open System.Data.SqlServerCe open Microsoft.FSharp.Data.TypeProviders open Microsoft.FSharp.Linq type dbSchema = SqlDataConnection<"Data Source=C:\Test\Test.sdf"> 

The database exists and was created using the VS11 Server Explorer / Data Connections / Add New Connection / Sql Server CE / Create dialog. No matter what I try, I always get the following error:

A provider of type 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error: Error reading schema. Error: Cannot open 'C: \ Test \ Test.sdf. The provider 'System.Data.SqlServerCe.3.5' is not installed.

What I have tried so far:

  • installed Sql Server Ce 3.5, but the error is still the same.
  • changed the connection string and added a link to the project:
    • "Provider = System.Data.SqlServerCe.3.5; Data Source = C: \ Test \ Test.sdf"
    • "Provider = System.Data.SqlServerCe.4.0; Data Source = C: \ Test \ Test.sdf"
+4
source share
1 answer

I know this question was asked a few years ago, but for future ref:

 [<Literal>] let connection_string =@ "Data Source=C:\Test\Test.sdf" type dbSchema = SqlDataConnection<connection_string> 
+1
source

Source: https://habr.com/ru/post/1400655/


All Articles