locked
Help Going nuts Error in connection string yet app can see it in edmx file RRS feed

  • Question

  • User36582938 posted

    I am using the following to connections one for sql server configuration on hostgator but im getting a failed to open error i dont no why obv their no typos in my db statement and i have these in my dll and also my web config. I am using EF VERSION 6.0 LATTEST generate from db method and also asp.net 4.5.2 Any ideas why it keeps crashing ?.

      <add name="SkyLarkArena" connectionString="Data Source=IP ADRESS;Initial Catalog=DBNAME;User ID=quine_skylarkb;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
    
      <add name="SkyLarkArenaEntities" connectionString="metadata=res://*/SkyLarkArena.csdl|res://*/SkyLarkArena.ssdl|res://*/SkyLarkArena.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=IP ADRESS;;initial catalog=DBNAME;user id=quine_skylarkb;password=Nto77z~7;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
    

    Does anybody no what im doing wrong when i debug it says im getting this error but im checking the credinetials its file obv i took out real ip address and db name for security here

    The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

    In my app config their in the connections strings tag

     

    <connectionStrings> <add name="SkyLarkArena" connectionString="Data Source=ip;database=DBNAME;User ID=quine_skylarkb;Password=Nto77z~7" providerName="System.Data.SqlClient" /> <add name="SkyLarkArenaEntities" connectionString="metadata=res://*/SkyLarkArena.csdl|res://*/SkyLarkArena.ssdl|res://*/SkyLarkArena.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=IP;initial catalog=DBNAME;user id=quine_skylarkb;password=Nto77z~7;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings> </configuration>

    Then in my web config the same place ? any ideas i going nuts here .

      <connectionStrings>
      <add name="SkyLarkArena" connectionString="Data Source=IP;Initial Catalog=DBNAME;User ID=quine_skylarkb;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
    
      <add name="SkyLarkArenaEntities" connectionString="metadata=res://*/SkyLarkArena.csdl|res://*/SkyLarkArena.ssdl|res://*/SkyLarkArena.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=IP;initial catalog=DBNAME;user id=quine_skylarkb;password=Nto77z~7;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
    
    </configuration>

    Sunday, December 20, 2015 8:16 PM

Answers

All replies

  • User-986267747 posted

    Hi buckd30,

    am using the following to connections one for sql server configuration on hostgator but im getting a failed to open error i dont no why obv their no typos in my db statement and i have these in my dll and also my web config. I am using EF VERSION 6.0 LATTEST generate from db method and also asp.net 4.5.2 Any ideas why it keeps crashing ?.

    According to your description, i'm not sure what is your problem, could you give me some error message and  describe your problem indetail? I couldn't give your any suggestion.

    Besides, if you use the database first in entity framework, you could refer to the following links to learn how to use it in our project. It's useful.

    https://www.asp.net/mvc/overview/getting-started/database-first-development/setting-up-database

    If you use the code first in entity framework, you could refer to the following link.

    https://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

    I hope it's helpful to you.

    Best Regards,

    Klein zhang

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 21, 2015 5:53 AM
  • User-2007907150 posted

    Not sure if this will help.  We always place the EDMX in a separate project (referring to it as the xxxxxLayer, where xxxxx is the database name).

    The metadata is located in <project name>\obj\Debug\edmxResourcesToEmbed\

    In web config the metadata is identified pretty much the same as you have:

    <add name="SpecialtyCareEntities"   connectionString="metadata=res://*/SpecialtyCare.csdl|res://*/SpecialtyCare.ssdl|res://*/SpecialtyCare.msl;provider . . .

    Once in a while the EDMX project will be updated and the name changed to the default Model# which then messes things up for the connection string.  Hope this helps.

    Monday, December 21, 2015 9:12 PM