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
Alexander K.
asked Mar 14 at 12:37
-
1I tried this in VS 2022, it worked for me.– Jim FoyeCommented 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).– Alexander K.Commented Mar 14 at 21:04
-
@JimFoye, what .NET version do you use?– Alexander K.Commented Mar 14 at 21:34
-
1Sorry 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 FoyeCommented Mar 21 at 3:34
-
@JimFoye, thank you!– Alexander K.Commented Mar 22 at 11:02
lang-ml