The usual way to use a provider of type SqlDataConnection is as follows:
type dbSchema = SqlDataConnection<"Data Source=MYSERVER\INSTANCE;InitialCatalog=MyDatabase;Integrated Security=SSPI;"> let db = dbSchema.GetDataContext()
However, we have a problem, which is that we want to use a provider of this type in f # script, where the connection string for the database is passed as a parameter. So, what I would like to do is something like this:
let connectionString= Array.get args 1 type dbSchema = SqlDataConnection<connectionString>
However, it gives the error "This is not a constant expression or a valid value for a user attribute"
Is there any way to do this?
source share