如何在 ADO.NET 实体数据模型中连接到 Oracle

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1318389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:51:21  来源:igfitidea点击:

How I can Connect to Oracle in ADO.NET Entity Data Model

.netvisual-studio-2008oracleentity-framework

提问by Wael Dalloul

Somebody advised me to use Entity Framework here when I asked this question: what is better to build Data layer, Strongly Typed DataSets or Classes

当我问这个问题时,有人建议我在这里使用实体框架: 构建数据层、强类型数据集或类哪个更好

So I read a lot of articles about Entity Framework, I understood that Entity Framework designed to be data-source independent and it will support most of the popular DBMSs.

所以我阅读了很多关于 Entity Framework 的文章,我明白 Entity Framework 被设计为独立于数据源,它将支持大多数流行的 DBMS。

I Have vs2008 with SP1, and I tried to add ADO.NET Entity Data Model, but I couldn't generate the model from Oracle connection, it seems that it's just supporting SQL Server!!

我有vs2008和SP1,我尝试添加ADO.NET实体数据模型,但是我无法从Oracle连接生成模型,看来它只是支持SQL Server!!

So does it support Oracle or not yet?!

那么它是否支持 Oracle 呢?!

回答by 362mike362

I also followed multiple tutorials for a model-first entity framework design with Oracle but they all hit the same dead-end.

我还学习了多个使用 Oracle 进行模型优先实体框架设计的教程,但它们都遇到了相同的死胡同。

I was able to connect to my Oracle database through Server Explorer but not when adding an ADO.NET Entity Data Model. All I saw was SQL Server Drivers to choose from.

我能够通过服务器资源管理器连接到我的 Oracle 数据库,但在添加 ADO.NET 实体数据模型时却不能。我看到的只是可供选择的 SQL Server 驱动程序。

I eventually ready this articlewhich stated the following:

我最终准备了这篇文章,其中说明了以下内容:

The 32-bit Oracle Developer Tools for Visual Studio download from http://otn.oracle.com/dotnetis required for Entity Framework design-time features and for other Visual Studio designers such as the TableAdapter Wizard. This NuGet download does not enable design-time tools, only run-time support.

实体框架设计时功能和其他 Visual Studio 设计器(如 TableAdapter 向导)需要从http://otn.oracle.com/dotnet下载适用于 Visual Studio 的 32 位 Oracle 开发人员工具。此 NuGet 下载不启用设计时工具,仅启用运行时支持。

Following the link provided from the article, I downloaded the 32-bit ODAC with Oracle Developer Tools for Visual Studio and this allowed me connect to my Oracle DB.

按照文章中提供的链接,我下载了带有 Oracle Developer Tools for Visual Studio 的 32 位 ODAC,这使我能够连接到我的 Oracle DB。