How do I solve "Keyword not supported: 'metadata' "?
24,131
Solution 1
That connection string is only supported by Entity Framework. (To be fair, the keyword "entities" is in the key name!) If you want to use the connection string in an ADO raw connection, remove anything outside the "
string parts, including the "
s:
Change it to:
<add name="Teleport_DEVEntities"
connectionString="data source=*****;initial catalog=****;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"
providerName="System.Data.EntityClient"
/>
Solution 2
It seems the connectionString is of EntityFramework Type. Possible way could be skipping metaData and then getting the complete connectionString.
The below code saved my time !!
if (connectionString.ToLower().StartsWith("metadata=")) {
System.Data.Entity.Core.EntityClient.EntityConnectionStringBuilder efBuilder = new System.Data.Entity.Core.EntityClient.EntityConnectionStringBuilder(connectionString);
connectionString = efBuilder.ProviderConnectionString; }
Author by
Batuhan Avlayan
Hi all, I am Batuhan AVLAYAN from Turkey. Just a developer.
Updated on June 30, 2020Comments
-
Batuhan Avlayan almost 4 years
I can't connect to SQL Server and connection string of my project is:
<add name="Teleport_DEVEntities" connectionString="metadata=res://*/Data.Model.AdvertisingModel.csdl|res://*/Data.Model.AdvertisingModel.ssdl|res://*/Data.Model.AdvertisingModel.msl;provider=System.Data.SqlClient;provider connection string="data source=*****;initial catalog=****;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I get this error:
Keyword not supported: 'metadata'
How can I fix this error?