I have the following code:
open FSharp.Data
[<Literal>]
let connectionString = @"Data Source=(local)\SQLExpress;Integrated Security=SSPI;Database=SfagStage"
type InsertEnhet = SqlCommandProvider<"Sql\InsertEnhet.sql", connectionString>
let insertEnhet (enhet:Enhet) =
let cmd = new InsertEnhet() // <<--- This generates an error runtime
cmd.Execute(enhet.Navn, enhet.Enhetsnummer, enhet.LEIKode, enhet.Kommune, DateTime.Now)
The row where I create the command is what causing the missing method I think. The part that of the exception that I think matters is:
System.MissingMethodException: Method not found: 'Void FSharp.Data.ISqlCommand Implementation..ctor(FSharp.Data.Connection, Int32, System.String, Boolean, System.Data.SqlClient.SqlParameter[], FSharp.Data.ResultType, FSharp.Data.ResultRank, Microsoft.FSharp.Core.FSharpFunc`2, System.String)'.