4

I want to use Oracle XE DB in my ASP.NET MVC project. I installed Oracle 11g XE on same machine where is VS running. Installation completed succesfully in C:\oraclexe. Everything as expected, i was able to connect to DB via Server Explorer using default .NET oracle data acces provider. But i want to use ODP.NET, so i installed ODP.NET + ODT in C:\app. Here is first confusing thing. Directory structure of C:\oraclexe..\server and C:\app..\client_1 is similar. Both have NETWORK\ADMIN folder where Tnsnames.ora resides. I understand that client is used to connect to database but:

  1. Which Tnsname.ora will be used to connect to database?
  2. Oraclexe also contains odp.net folder where Oracle.DataAccess.dll resides. If server installation come with odp.net why i need to install ODAC? Server Explorer in VS offered me ODP.NET drivers for connection only after ODAC install.
  3. ODAC comes with Oracle Instant Client. When to use Oracle Client and when Oracle Instant Client? If i decide for Oracle Client and then i will install ODAC for connection, will it also install Instant Client which is part of ODAC?
  4. Finally after installation of server and client, VS 2010 still does not offer me Oracle Providers in ASP.NET Configuration
4

1 回答 1

2

Oracle XE 有点特殊,因为您通常将服务器和客户端安装在同一台机器上。从逻辑上讲,它们是分开的,但这确实使事情变得更难理解。出于这个原因,我会参考其他专家。

  1. ORAFAQ 的人有关于 TNSNAMES.ORA 文件的信息。我个人的策略是使我所有的 TNSNAMES.ORA 文件都相同,这样就不会有混淆的机会。

  2. ODP.NET 用于....NET使用,而 ODAC 是“本机”(OLE) 并提供的工具比仅使用 ODP.NET 可能拥有的更多。使用适合您需要的任何东西。

  3. 在大多数情况下,您将分发 Instant Client。完整客户端对开发人员更有用。有关详细信息,请参阅文档常见问题解答。您可以在一台机器上拥有多个客户端,所以我不确定问题是什么。

  4. 重启机器?您是否将适当的库添加到您的环境中?

于 2012-02-09T22:31:46.940 回答