jwood803
3/30/2015 - 3:54 PM

sqlProviderDemo.fs

#I "../packages/SQLProvider.0.0.9-alpha/lib/net40"

#r "System.Data.dll"
#r "FSharp.Data.TypeProviders.dll"
#r "System.Data.Linq.dll"

open System.Data
open System.Data.Linq
open Microsoft.FSharp.Data.TypeProviders

type db = SqlDataConnection<"Data Source=localhost\SQLEXPRESS;Initial Catalog=northwind;Integrated Security=SSPI;">

let context = db.GetDataContext()

let q = query { for c in context.Customers do
                select c.CustomerID }

let q2 = query { for c in context.Categories do
                  select c.Picture }

context.CustOrderHist "ALFKI"