Created
December 27, 2013 17:14
-
-
Save SoulFireMage/8149809 to your computer and use it in GitHub Desktop.
First shot at using a Type Provider, last year :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Data | |
open System.Data.Linq | |
open Microsoft.FSharp.Data.TypeProviders | |
open Microsoft.FSharp.Linq | |
type dbschema = SqlDataConnection<"Data Source=Katrina\SQLExpress;Initial Catalog=RCPD;Integrated Security=SSPI;"> | |
let db = dbschema.GetDataContext() | |
db.DataContext.Log |> System.Console.Out | |
let query1 = | |
query { | |
for row in db.TableName do | |
select row | |
} | |
query1 |> Seq.iter (fun row -> printfn "%A %A" row.SomeId row.SomeName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment