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
asked Mar 14, 2025 at 12:37
Alexander K.
1331 silver badge8 bronze badges
-
1I tried this in VS 2022, it worked for me.Jim Foye– Jim Foye2025年03月14日 19:59:07 +00:00Commented Mar 14, 2025 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.– Alexander K.2025年03月14日 21:04:22 +00:00Commented Mar 14, 2025 at 21:04
-
@JimFoye, what .NET version do you use?Alexander K.– Alexander K.2025年03月14日 21:34:12 +00:00Commented Mar 14, 2025 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 Foye– Jim Foye2025年03月21日 03:34:22 +00:00Commented Mar 21, 2025 at 3:34
-
@JimFoye, thank you!Alexander K.– Alexander K.2025年03月22日 11:02:04 +00:00Commented Mar 22, 2025 at 11:02
lang-ml