This project is read-only.
TypeProvider min/max

Category:
TypeProviders.SqlDataConnection
Description: use min and max to get the youngest and oldest students.
Code:
type T0 = Microsoft.FSharp.Data.TypeProviders.SqlDataConnection< "Data Source=localhost;Initial Catalog=FSharpSample;User ID=sa;Password=FSharpSample1234" >

let TypeProvider18() =
let db = T0.GetDataContext();
let q = query {
for n in db.Student do
minByNullable n.Age
}
q |> printfn "min age = %A"

let q = query {
for n in db.Student do
maxByNullable n.Age
}
q |> printfn "max age = %A"


Execution Result:
min age = 20
max age = 23

Last edited Mar 1, 2012 at 8:04 PM by ttliu2000, version 2

Comments

No comments yet.