Chinaunix首页 | 论坛 | 博客
  • 博客访问: 873157
  • 博文数量: 372
  • 博客积分: 10063
  • 博客等级: 中将
  • 技术积分: 4220
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-24 11:36
文章分类

全部博文(372)

文章存档

2012年(372)

分类: 虚拟化

2012-03-08 16:29:23

用 OData Service 访问 US Bank

// 编译命令
//"C:\Program Files\Microsoft SDKs\F#\3.0\Framework\v4.0\fsc.exe" --optimize- --tailcalls- --platform:x86 -r:"C:\Program Files\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll" -r:"E:\Projects\F#3\FSharp.Data.TypeProviders.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Profile\Client\System.Core.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Profile\Client\System.Data.Services.Client.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Profile\Client\System.dll" --noframework TypeProviderODataUSBank.fsx

#if INTERACTIVE
#r @"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll";;
#endif
open System.Data.Services.Client;;
#if INTERACTIVE
#r @"E:\Projects\F#3\FSharp.Data.TypeProviders.dll"
#endif
open Microsoft.FSharp.Data.TypeProviders;;

open System.Net;;

[]
type BankInfo = ODataService<"">

let BrachInfo() =
let bank = BankInfo.GetDataContext()
bank.Credentials <- new NetworkCredential("MSN帐号","主帐户密钥")
let q = query {
for b in bank.BranchInfo2011 do
where (b.BranchState = "WA")
where (b.BranchZip = "98052")
select b
}
q |> Seq.iter ( fun n -> printfn "%A - %A" n.BranchName n.BranchDeposits)

BrachInfo()
阅读(436) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~