This project is read-only.
Using the type provider sample

Category:
TypeProviders.SqlDataConnection
Description: type provider sample. 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 TypeProvider1() =
let db = T0.GetDataContext();
let q2 = query {
for n in db.Course do
select n.CourseName
}
q2 |> Seq.iter (fun n -> printfn "%A" n)
Assert.AreEqual(q2 |> Seq.length, 4)

Execution Result:
"Math"
"Physics"
"Biology"
"English"
both elements are equal

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

Comments

No comments yet.