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

Was it helpful?

Solution

I got it, it was missing , between key and count

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top