[英]How to add an Oracle Server for a Visual Studio 2012 MVC Entity Framework Project?
I have been trying to add an Oracle Server via Add Connection option provided in the Data Connections Section of Server Explorer. 我一直在尝试通过Server Explorer的Data Connections部分中提供的Add Connection选项添加Oracle Server。 I have been using Oracle 10g Express Edition to connect to via Entity Framework.
我一直在使用Oracle 10g Express Edition通过实体框架进行连接。 Whenever I pot for adding the server connection is throws up errors.
每当我添加服务器连接罐时,都会引发错误。 What am I possibly missing ?
我可能会想念什么? I tried all the solutions I could find on net and here is what my connectionString looks like :
我尝试了所有可以在网上找到的解决方案,这是我的connectionString的样子:
<connectionStrings>
<add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="Data Source=(DESCRIPTION=
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= CHIRANJIB_VAIO)(PORT=1521)))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME= XE)));
User Id=hr ;Password=hr" />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MvcApplication4-20151115215423;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MvcApplication4-20151115215423.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
Below are the screenshots of my attempts at it : 以下是我尝试的屏幕截图:
and .... 和...
I tried 'XE' , 'localhost' etc. as the Server Names . 我尝试使用“ XE”,“ localhost”等作为服务器名称。 But apparently nothing worked out.
但显然没有任何结果。
Change the HOST = CHIRANJIB_VAIO
to HOST = localhost
if it's a local server, and check in your tnsnames.ora
file to be sure that it's a DEDICATED
server. 如果它是本地服务器,则将
HOST = CHIRANJIB_VAIO
更改为HOST = localhost
,然后检入tnsnames.ora
文件以确保它是DEDICATED
服务器。
Also, have you installed the NuGet package
? 另外,您是否安装了
NuGet package
?
Starting with 10g clients, you can use the EZCONNECT feature, which does not require to edit the TNSNAMES.ORA file. 从10g客户端开始,您可以使用EZCONNECT功能,该功能不需要编辑TNSNAMES.ORA文件。 For instance:
例如:
<add name="RagTools" connectionString="DATA SOURCE=localhost:1521/DEV;PASSWORD=***;PERSIST SECURITY INFO=True;USER ID=UserName" providerName="Oracle.ManagedDataAccess.Client" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.