This project is read-only.
EDMX Provider

Category:
TypeProviders.Others
Description: define a EDMX type provider on the local SQL server 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 T2 = Microsoft.FSharp.Data.TypeProviders.EdmxFile< @".\Support.Model.edmx" >

let typeEdmxProvider() =
let db = new T2.FSharpSampleModel.Entities("metadata=res://*/Support.Model.csdl|res://*/Support.Model.ssdl|res://*/Support.Model.msl;provider=System.Data.SqlClient;provider connection string=\"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 "%A" n)


Execution Result:
"Lisa"
"Brent"
"Anita"
"Ken"
"Cathy"
"Tom"
"Zeoy"
"Mark"
"John"

Last edited Mar 1, 2012 at 8:10 PM by ttliu2000, version 3

Comments

No comments yet.