connectionStrings

Discussion in 'ASP.NET / ASP.NET Core' started by simobee, Dec 15, 2011.

  1. Hi,

    I am a newbie to ASP.NET and trying to setup a very simple application.
    It has one database which includes Membership and a few more tables that I added to it using entity framework. I have following local connection string and both were created for me as I go through wizard to add database. Locally, it launches and both connections work.

    web.config:

    <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|IMO.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="IMOEntities" connectionString="metadata=res://*/Models.IMO.csdl|res://*/Models.IMO.ssdl|res://*/Models.IMO.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\IMO.MDF;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>


    Then, I created Web.Release.Config to transfer the setting to the Hosting server.

    <connectionStrings>
    <add name="ApplicationServices"
    connectionString="Data Source=tcp:sql2k805.discountasp.net;Initial Catalog=SQL2008R2_850679_imo;User ID=SQL2008R2_850679_imo_user;Password=hnh4ever;"
    xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
    <connectionStrings>
    <add name="IMOEntities"
    connectionString="Data Source=tcp:sql2k805.discountasp.net;Initial Catalog=SQL2008R2_850679_imo;User ID=SQL2008R2_850679_imo_user;Password=hnh4ever;"
    xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>


    Then, I run the real website from Server, I am getting following errors. I beleive it is complaining about IMOEntities. I've been playing with this for very long time, so I would really appreciate if anyone can help me resolve this issue.

    Basically, I want the Membership and want to add more tables to One Database. However, that seems very hard!!! I also can't find a easy to read source that explains how to do this.


    [ArgumentException: Keyword not supported: 'data source'.]
    System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5108036
    System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
    System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +8129750
    System.Data.EntityClient.EntityConnection..ctor(String connectionString) +81
    System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +42
    IMO.Models.IMOEntities..ctor() +16
    IMO.Controllers.ItemController..ctor() +23
     

Share This Page