Question

I have an ASP.Net project that I am running. I have added a database to Azure, and Azure generated a connection string for the database. When running the application I however get an error stating that the server keyword within the string is not supported. Here is my connection string:

/**/
<add name="AnimalEntities" connectionString="Server=tcp:uuu.database.windows.net,1234;Initial Catalog=MyDataBaseName;Persist Security Info=False;User ID=xfakeID;Password=xxxfakePassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.EntityClient" />
/**/

I have analysed the answer on here but haven't been able to figure out what my eventual string should be.

How should I structure my string?

Was it helpful?

Solution

As marc_s stated in the accepted answer (in the link provided in the question):

For Entity Framework ... you need to use a special type of connection string which is quite different from the straight ADO.NET connection strings ...

Your provider, as shown in the code in this question, is: System.Data.EntityClient. Yet you are using standard ADO.NET connection string keywords.

You can either:

  1. change the connection string to be similar to what is shown in marc_s's accepted answer,

    OR

  2. change the provider name as shown in the #2 answer (by WasiF), which is really just changing EntityClient to be SqlClient

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top