This project is read-only.
DBML Provider

Category:
TypeProviders.Others
Description: Use DBML provider for FSharpSample database. You can download the SQL server 2008 Express version for free. Please refer to CreateFSharpSampleDatabase.sql or run Setup project to configure your database.
Code:

type T1 = Microsoft.FSharp.Data.TypeProviders.DbmlFile< @".\Support.DataClasses.dbml" >
let typeDBMLProvider() =
let db = new T1.DataClasses1DataContext("Data Source=localhost;Initial Catalog=FSharpSample;User ID=sa;Password=FSharpSample1234")
let q = query {
for n in db.Students do
select n.Name }
q |> Seq.iter (fun n -> printfn "student name = %s" n)


Execution Result:
student name = Lisa
student name = Brent
student name = Anita
student name = Ken
student name = Cathy
student name = Tom
student name = Zeoy
student name = Mark
student name = John

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

Comments

No comments yet.