2

First of all I've read this article and I'm having a different issue.

I'm using DevExtreme and upon debugging I'm getting an error whilst trying to execute this code:

public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);
    }
}

It says

"Keyword not supported: 'metadata'."

However my the providerName of my connectionString (in the web.config file) is "System.Data.EntityClient" as advised multiple times in this article.

My connectionString looks like this:

<add name="CCBEntities" connectionString="metadata=res://*/Models.ContosoModel.csdl|res://*/Models.ContosoModel.ssdl|res://*/Models.ContosoModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\CCB.mdf;integrated security=True;multipleactiveresultsets=True;connect timeout=30;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

I'm passing this value over like this:

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CCBEntities %>"
    SelectCommand="SELECT * FROM [CcbTeam]">
</asp:SqlDataSource>

How can I remove this error?

  • Why not just adding supplementary connection string using `SqlClient` provider with different key name? You can copy the section inside `provider connection string`, format it and set `SqlDataSource`'s `ConnectionString` property to a new key name. – Tetsuya Yamamoto Oct 16 '18 at 07:37
  • @TetsuyaYamamoto So I've copied the connectionString and renamed providerName from `System.Data.EntityClient` to `System.Data.SqlClient`. I gave it another key name as well. What do you mean with _format it_? –  Oct 16 '18 at 07:44
  • Remove `metadata`, `application name=EntityFramework` and other EF-related options, also use `providerName="System.Data.SqlClient"`. Then your setup with new key name should be fine. – Tetsuya Yamamoto Oct 16 '18 at 07:48
  • @TetsuyaYamamoto "Keyword not supported: 'provider'." It seems to be having an issue with my connectionString. My connectionString looks like this now: `` –  Oct 16 '18 at 07:53
  • The correct one should be this: ``. The EF-related properties should be removed. – Tetsuya Yamamoto Oct 16 '18 at 07:55
  • @TetsuyaYamamoto Listen man, it works. Thanks a lot. I know it's my first time working with connection strings so I don't really know the difference of the properties yet. –  Oct 16 '18 at 07:59

0 Answers0