2

I can't seem to get the SqlProgrammabilityProvider to work even in the most basic configuration. With this code

type TestDb = SqlProgrammabilityProvider<testConn>
let db = TestDb()

I get the design/compile-time error "The value or constructor 'TestDb' is not defined"

testConn is a literal string that is working fine with the SqlCommandProvider in the same project.

I'm using VS 2015, FSharp.Data.SqlClient 1.7.5, and I've tried targeting .NET 4.5.2 and 4.6.

Are there known issues or limitations with this? If not, how could I troubleshoot it?

asked Aug 3, 2015 at 15:08
1

1 Answer 1

2

After getting a type for SqlProgrammabilityProvider upon a specific connection you should tie it to as many as you like, but of the concrete following options: Sql Server function, stored procedure, or table.

Like in:

type TestDb = SqlProgrammabilityProvider<testConn>
type Datatable = TestDb.dbo.Tables.MyDataTable

or

use cmd = TestDB.dbo.MyStoredProcedure()
cmd.Execute(Param1="xyzzy")

You may peek at use cases at https://github.com/fsprojects/FSharp.Data.SqlClient/tree/master/src/SqlClient.Tests

answered Aug 3, 2015 at 15:45
1
  • 1
    I think you've pointed me in the right direction. I was looking at link which is maybe out of date? Also I had to do a clean project before even the correct syntax would work. Commented Aug 3, 2015 at 16:17

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.