This project is read-only.
TypeProvider query TOP case

Description: type provider sample using TOP. Use the CreateFSharpSampleDatabase.sql to setup your database tables.
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 8:00 PM by ttliu2000, version 3


No comments yet.