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

enter image description here

asked Mar 14 at 12:37
5
  • 1
    I tried this in VS 2022, it worked for me.
    Jim Foye
    Commented Mar 14 at 19:59
  • @JimFoye, thanks for the feedback. I use VS Code. I'll give it a try in VS 2022 (have to install it first). Commented Mar 14 at 21:04
  • @JimFoye, what .NET version do you use? Commented Mar 14 at 21:34
  • 1
    Sorry for the delayed reply. I just created added a script to a VS 2022 solution (had to change the connection string to point to a database I had installed), and there were no errors.
    Jim Foye
    Commented Mar 21 at 3:34
  • @JimFoye, thank you! Commented Mar 22 at 11:02

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.