4
votes

I have the following F# script. I copied the connection string from a working Asp.net Mvc project. However, it got the following error. The connection string should be correct since the Asp.Net Mvc project works fine. Or does F# type provider not accept the connection string?

#r "System.Data.Entity.dll"
#r "FSharp.Data.TypeProviders.dll"
#r "System.Data.Linq.dll"

open System.Data.Linq
open System.Data.Entity
open Microsoft.FSharp.Data.TypeProviders

type private EntityConnection = SqlEntityConnection<ConnectionString=
    "Data Source=(LocalDb)\v11.0;Initial Catalog=MyDB;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MyDb.mdf",
    Pluralize = true>

Script1.fsx(9,33): error FS3033: The type provider 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error: Error reading schema. error 7001: The provider did not return a ProviderManifestToken string. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) The network path was not found

1
I do not think this is a problem with the type provider. Can you connect to the database if you use the same connection string with the good old SqlConnection? - Tomas Petricek

1 Answers

10
votes

You might want to check that v in v11.0, it's been known to cause some problems. Even if your connection isn't set to be case sensitive, try upper-casing it and see if it works: V11.0.