Using entities framework

Discussion in 'Databases' started by ekat, Sep 9, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a WCF service (.NET 4.0) I'm trying to host which uses the entites framework.

    And I'm not sure what my connection string should look like (or if I'm doing any of this correctly.)

    Locally I use an mdf file (Software.mdf) and I created an entites mapping called SoftwareEntites.edmx.

    The auto-generated connectionStrings looks like this:

    Code:
    <connectionStrings>
    <add name="SoftwareEntities" connectionString="metadata=res://*/SoftwareEntities.csdl|res://*/SoftwareEntities.ssdl|res://*/SoftwareEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Software.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>
    Then I imported the mdf file to my database server on discoutasp.net to make sure all of the tables were correctly created, and finally I published the application using this connection string information in the web config file:

    Code:
    <connectionStrings>
        <clear />
        <add name="SoftwareEntities"
             
             connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=tcp:sql2k804.discountasp.net;Initial Catalog=the name of my database with the correct tables;User ID=My main username;Password=the password for main username;&quot;" 
             providerName="System.Data.EntityClient" />
      </connectionStrings>
    I can't get it to work either after publishing it or running it locally with that connection string. Any ideas on how the connection string should look - or if there is something else I'm doing totally wrong?

    Thanks for your help!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page