简体   繁体   English

如何为Visual Studio 2012 MVC实体框架项目添加Oracle服务器?

[英]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.

相关问题 在Visual Studio 2012或更高版本中使用Npgsql和Entity Framework的MVC4 - MVC4 using Npgsql and Entity Framework in Visual Studio 2012 or higher 具有Visual Studio 2010和Entity Framework兼容性的MS SQL Server 2012 - MS SQL Server 2012 with Visual Studio 2010 and Entity Framework compatibility 使用Studio和实体框架进行Visual Studio 2012测试 - Visual Studio 2012 testing with csla and entity framework 如何将ADO.net实体模型框架添加到Visual Studio 2017以连接Oracle DB? - How add ADO.net entity model framework to Visual Studio 2017 to connect Oracle DB? 将实体框架与现有的ORACLE DB一起使用。 Visual Studio 2012和不建议使用的ODP.NET驱动程序 - Use Entity Framework with existing ORACLE DB. Visual Studio 2012 and Deprecated ODP.NET Driver 将Visual Studio 2012 ASP.NET(4.5框架)项目部署到Server 2012 R2 Standard - Deploy Visual Studio 2012 ASP.NET (4.5 Framework) project to Server 2012 R2 Standard 哪个实体框架在 Visual Studio 2012 和 ASP.NET MVC 4 和 Windows 7 中使用? - Which Entity Framework is used in Visual Studio 2012 with ASP.NET MVC 4 with Windows 7? 将实体框架7添加到MVC 5项目 - Add Entity Framework 7 to an MVC 5 project 如何在Visual Studio 2013中为MVC项目添加测试项目 - How to Add Test Project for MVC Project in Visual Studio 2013 缺少实体框架连接字符串后的Visual Studio 2012 Stackoverflow - Visual Studio 2012 stackoverflow after entity framework connectionstring missing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM