I got it, it was missing , between key and count
f# type provider using simple groupby and count
-
28-06-2022 - |
Question
why is this not compiling
open System
open System.Data
open System.Data.Linq
open System.Linq
open Microsoft.FSharp.Data.TypeProviders
open Microsoft.FSharp.Linq
open Microsoft.FSharp.Linq.RuntimeHelpers
type dbSchema = SqlDataConnection<"Data Source=.;Initial Catalog=MyDatabase;Integrated Security=SSPI;">
let db = dbSchema.GetDataContext()
query {
for row in db.Table1 do
groupBy row.Id into gr
select( gr.Key (gr.Count()))
}
|> Seq.iter (fun row -> printfn "Found row: %d" row.Count)
i get compile error in line
select( gr.Key (gr.Count()))
with error Error : This value is not a function and cannot be applied
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow