Can't Compile using SqlDataConnection in F# on Mono in Linux

I am using mono on Linux, making an F# code to access an SQL Server Database. I am using SqlDataConnection.

My code is the following:

  • Should the script component be called when 0 rows are sent to it in a data flow?
  • Deadlock because of update query
  • How to efficiently group by date with a timezone specified?
  • MSSQL Run stored procedure multiple times concurrently
  • SQL Server 2008 - Add XML Declaration to XML Output
  • Creating Default columns in SQL 2008 using Policy management (DMF)
  • namespace AggregatorService
    
    open FSharp.Data.TypeProviders
    open System.Data
    open System.Data.Linq
    
    module DataBaseProvider = 
    
        type databaseConn = SqlDataConnection<ConnectionString = "Data Source=10.0.40.11;Initial Catalog=master;Persist Security Info=True;User ID=sa;Password=xxxxx">
    
        let getDataContext() =
            let dbConn = databaseConn.GetDataContext();
            dbConn
    

    I can’t compile this code. I am getting this annoying error:

    The type provider ‘FSharp.Data.TypeProvider.DesignTime.DataProviders’ reported an error reading schema. No access to the given key (FIS3033)

    My package.config file is:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="Deedle" version="1.2.5" targetFramework="net40" />
      <package id="FSharp.Core" version="4.0.0.1" targetFramework="net40" />
      <package id="FSharp.Data" version="2.3.2" targetFramework="net40" />
      <package id="FSharp.Data.SqlClient" version="1.8.2" targetFramework="net40" />
      <package id="FSharp.Data.TypeProviders" version="5.0.0.2" targetFramework="net40" />
      <package id="NUnit" version="2.6.4" targetFramework="net40" />
      <package id="SQLProvider" version="1.0.22" targetFramework="net40" />
    </packages>
    

    A C# program is connecting from the same computer, so, I think the problem is not with mono configurations or to be in a Linux machine.

    Anyone has a solution or a Tip on how to solve that?

    One Solution collect form web for “Can't Compile using SqlDataConnection in F# on Mono in Linux”

    Unfortunatelly it looks mono is not able to deal this package as well I wish. Searching I found there is a bug from two years ago, but I don’t find any solution yet.

    What I am doing to leave that is using FSharp.Data.Sql instead, then, I use SqlDataProvider instead of SqlDataConnection, ow it looks:

    namespace AggregatorService
    

    open FSharp.Data.Sql
    open Deedle
    open System.Linq

    module DatabaseService =

    [<Literal>]
    let connectionString = "Data Source=10.0.40.11;Initial Catalog=nextel_ericsson_umts_brasil;Persist Security Info=True;User ID=sa;Password=****";
    
    type bd = SqlDataProvider<
                ConnectionString = connectionString,
                DatabaseVendor = Common.DatabaseProviderTypes.MSSQLSERVER >
    
    type Database() =
    
        static member contextDbo() =
            bd.GetDataContext().Dbo
    
        static member acAgregations() =
            Database.contextDbo().AcAgregations |> Frame.ofRecords
    
        static member acBusyHourDefinition() =
            Database.contextDbo().AcBusyHourDefinition
            |> Frame.ofRecords
            //|> Frame.getCols["time_agregation_type", "destination_table", "reference_table", "alternative_reference_table_scan", "formula"]
    
        static member acBusyHourDefinitionFilterByTimeAgregationTipe(value:int) = 
            Database.acBusyHourDefinition()
            |> Frame.indexRowsInt "tome_agregation_type"
            |> Frame.getRows
            |> Frame.filterRowValues( fun row -> row.GetAs<string list>)
    

    As I can see, that works the same way. I don’t know if there is some difference expected, but it’s dealing with my needs until now.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.