简体   繁体   English

数据库连接字符串错误

[英]Database Connection String error

Currently I am running MVC project using Oracle as my database. 目前,我正在使用Oracle作为数据库运行MVC项目。

When my solution runs, it throws the exception: 当我的解决方案运行时,它将引发异常:

'entitycommandexecutionexception'. 'entitycommandexecutionexception'。

I thought my webconfig file has some issues, so I looked in my webconfig. 我以为我的webconfig文件有一些问题,所以我查看了我的webconfig。 When I tried to save it, my file was saved with the an error message 当我尝试保存它时,我的文件被保存并显示一条错误消息

"The 'data source' keyword is not supported". “不支持“数据源”关键字”。

My webconfig connectionstring is as follow: 我的webconfig连接字符串如下:

<connectionStrings>
        <add name="bob" connectionString="metadata=res://*/Entities.bob.csdl|res://*/Entities.bob.ssdl|res://*/Entities.bob.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=localhost/XE;PASSWORD=bobsamuel;PERSIST SECURITY INFO=True;USER ID=bobsamuel&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

Your connection string is wrong. 您的连接字符串错误。 Pay attention on " providerName " part. 注意“ providerName ”部分。 Your's currently set to "System.Data.EntityClient" but it should be "Oracle.ManagedDataAccess.Client" - if you are using official Oracle driver. 您的当前设置为“ System.Data.EntityClient”,但如果使用的是官方Oracle驱动程序,则应为“ Oracle.ManagedDataAccess.Client”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM