1

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?

1

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

  • I have managed to build the connectionstrint. The only issue is the metadata. Im getting an error stating that resources can not before. These are the csdl files etc. Im commenting from the stack exchange app. So i cant give more details right now. I will update with my current connection string when i get to a computer. I am mostly new to asp.net, core and related technologies. – pnizzle Jan 10 at 6:58
  • I don't know how those values are supposed to work. I would try option #2 first. – Solomon Rutzky Jan 10 at 7:01
  • Oh, I hadn't looked at option 2. I have already tried that one. I am using entity framework. Changing the provider to SqlClient resulted in another error, unless there's more to it... – pnizzle Jan 10 at 22:32
  • Well, I forgot to mention that I am building and running on Visual Studio for Mac. I have now run the same project on windows, deployed using IIS Express, and I don't get any exception relating to the resources not being found anymore. All seems to be fine. Im using solution one – pnizzle Jan 11 at 1:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.