Connected to Database through VS2010 - How do I create a entity datasource

Discussion in 'Getting started' started by 5pence00, Jun 14, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi guys, here is my connection string in Web.Config (Note I'm using Entity framework):

    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="OilenniumEntity" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=tcp:esql2k802.discountasp.net;Initial Catalog=SQL2008_740396_5pence;Persist Security Info=True;User ID=SQL2008_740396_5pence_user;Password=******;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />


    I tried my site and it works until I try to talk to DB, I get the error message:

    Unable to load the specified metadata resource.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.MetadataException: Unable to load the specified metadata resource.

    it originates when trying to talk to the DB in a databind() method.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    You connection string is definitely wrong. As it is, it is trying to connect to a SQL Express database.
     
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