Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type provider cannot connect to localDB

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

like image 414
ca9163d9 Avatar asked Dec 27 '22 00:12

ca9163d9


1 Answers

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.

like image 157
sker Avatar answered Jan 02 '23 17:01

sker