TypeProvider query TOP case

Category:
TypeProviders.SqlDataConnection
Description: type provider sample using TOP. Use the CreateFSharpSampleDatabase.sql to setup your database tables.
Code:
type T0 = Microsoft.FSharp.Data.TypeProviders.SqlDataConnection< "Data Source=localhost;Initial Catalog=FSharpSample;User ID=sa;Password=FSharpSample1234" >

let TypeProvider6() =
let db = T0.GetDataContext();
let q = query {
for n in db.Student do
where (SqlMethods.Like( n.Name, "_a") )
select n
take 2
}
q |> Seq.iter (fun n -> printfn "%s" n.Name)
Assert.AreEqual(q |> Seq.length, 0)

Execution Result:
both elements are equal

Last edited Mar 1, 2012 at 7:00 PM by ttliu2000, version 3

Comments

No comments yet.