Keyword not supported: "metadata"

I am trying to publish an mvc 3 project, but I cannot connect to the sql server (using EF) due to an invalid connection string. There he is:

  <add name="PackStoreEntities" connectionString="metadata=res://*/Models.PackStore.csdl|res://*/Models.PackStore.ssdl|res://*/Models.PackStore.msl;provider=System.Data.SqlClient;provider connection string=&quot;workstation id=PackStore.mssql.somee.com;packet size=4096;user id=*****;pwd=****;data source=PackStore.mssql.somee.com;persist security info=False;initial catalog=PackStore&quot;" providerName="System.Data.EntityClient" />

I accepted this part of my hoster:

workstation id=PackStore.mssql.somee.com;packet size=4096;user id=*****;pwd=****;data source=PackStore.mssql.somee.com;persist security info=False;initial catalog=PackStore

The Mvc project works well on the local server, but when I publish, I get "Keyword not supported: metadata." Where is my mistake? Thnaks for answers.

+3
source share
7 answers

try this one ...

<add name="PackStoreEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string='Data Source=PackStore.mssql.somee.com;Initial Catalog=PackStore;User ID=***;Password=****;'"  providerName="System.Data.EntityClient" />

Change ..

<add name="PackStoreEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string='workstation id=PackStore.mssql.somee.com;packet size=4096;user id=*****;pwd=****;data source=PackStore.mssql.somee.com;persist security info=False;initial catalog=PackStore;'" providerName="System.Data.EntityClient" />
+4
source

Linq To Sql Entity, . , asp: SqlDataSource asp: EntityDataSource.

:

    <asp:SqlDataSource ID="SqlDataSourceProducts" runat="server" SelectCommand="SELECT Id, Description FROM [Product]"
        ConnectionString="<%$ ConnectionStrings:crmConnectionString %>" CacheDuration="5" CacheExpirationPolicy="Absolute">
    </asp:SqlDataSource>

:

    <asp:EntityDataSource ID="SqlDataSourceProducts" runat="server" Select="Id, Description"
        EntitySetName="Products" ConnectionString="<%$ ConnectionStrings:crmConnectionString %>" DefaultContainerName="CRM" >
    </asp:EntityDataSource>
+2

web.config : Entity Frame ADO.net

:

<connectionStrings>
        <add name="LoginDB" connectionString="Data Source=****;Initial Catalog=int422_113b16;User ID=****;Password=****" />
        <add name="BlogEntities" connectionString="metadata=res://*/App_Code.BlogModel.csdl|res://*/App_Code.BlogModel.ssdl|res://*/App_Code.BlogModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source****;initial catalog=int422_113b16;user id=****;password=****;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
+1

. . - .

, naim

0

, , - &quot; , , ...

0

, , web.config, . , , , Visual Studio. . , , , . -, , web.config. , , , , .

You should be able to create a strong presentation using any of the tables in your model. This is what I did for myself, I did not modify the connection string, like many of them, or deleted the metadata.

Check out this troubleshooting guide so that it can shed some light and help you understand how the connection to the entity works.

0
source

I had the same exception, but I was able to fix it by keeping ConnectionStringthe same, but using EntityConnectioninstead SqlConnection.

0
source

All Articles