当前位置: 首页 > 业界动态 > 技术实现 > 本文


利用OData Service访问MarketBank




发布时间: 2012-8-1 15:11:16  
// 编译命令
//"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 TypeProviderODataMarketBank.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;;
 
[<Generate>]
type MarketBank = ODataService< @"https://api.datamarket.azure.com/RpmConsulting/MarketBank/" >
 
let MarketBank() =
let db = MarketBank.GetDataContext()
db.Credentials <- new NetworkCredential("MSN帐号","主帐户密钥")
 
let q = query {
for b in db.MarketBank2010 do
where (b.StateAbbreviation = "WA")
sortBy (b.Id)
select b
}
 
q |> Seq.iter (fun n -> printfn "%A - %A" n.Id n.AnnuitiesPenetrationIndex)
 
MarketBank()
本文来源:CSDN
 
相关文章推荐:手工创建、编译和运行Java程序
分享到:
阅读:1308次
推荐阅读:

版权所有 © 2011-2016 南京云创大数据科技股份有限公司(股票代码:835305), 保留一切权利。(苏ICP备11060547号-1)  
云创大数据-领先的云存储、大数据、云计算产品供应商