[英]How to fix this Keyword not supported “provider” for C#?
First, I had similar problem Keyword not supported for "metadata". 首先,我有类似的问题“元数据”不支持关键字。 So, I wrote data source instead of metadata.
因此,我写了数据源而不是元数据。 After that, I tried to create Controller for ASP.NET MVC and that show me Keyword not supported for "provider".
在那之后,我尝试为ASP.NET MVC创建Controller,并向我显示“提供商”不支持的关键字。 I read the some case for SQL SERVER connection, but I didn't found for Oracle connection.
我阅读了一些有关SQL SERVER连接的案例,但没有找到Oracle连接。 Here is my connectionStrings in web.config file.
这是我在web.config文件中的connectionStrings。
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MVC-20170801212521;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MVC-20170801212521.mdf" providerName="System.Data.SqlClient" />
<add name="EntitiesLL" connectionString="Data Source=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=Oracle.ManagedDataAccess.Client;data source=****:1111/xe;password=******;user id=******;" providerName="System.Data.SqlClient" />
</connectionStrings>
Thank you. 谢谢。
The problem is this 问题是
providerName="System.Data.SqlClient"
Something tells me it should be OracleClient
. 告诉我应该是
OracleClient
。
According to official documentation this should read: 根据官方文档,此内容应为:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MVC-20170801212521;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MVC-20170801212521.mdf" providerName="System.Data.SqlClient" />
<add name="EntitiesLL" connectionString="Data Source=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;data source=****:1111/xe;password=******;user id=******;" providerName="Oracle.ManagedDataAccess.Client" />
</connectionStrings>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.