最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

type providers - F# FSharp.Data.SqlClient error 0x8007007E - Stack Overflow

programmeradmin2浏览0评论

I'm attempting to implement the very first example from here and I'm getting Unable to load DLL 'sni.dll' or one of its dependencies error. I have .NET 8/VS Code. Any thoughts?

#r "nuget: FSharp.Data.SqlClient, 2.1.2"

open FSharp.Data

[<Literal>]
let connectionString = 
    @"Server=localhost;Database=AdventureWorks2017;Trusted_Connection=True;"

let getProducts () = 
    let cmd = new SqlCommandProvider<"
        SELECT TOP (1000) 
        [ProductID]
        ,[Name]
        ,[Color]
        FROM [Production].[Product]" , connectionString>(connectionString)
    
    cmd.Execute()

[<EntryPoint>]
let main argv =
    let products = getProducts()
    products |> printfn "%A"
    0

发布评论

评论列表(0)

  1. 暂无评论