楼主: rainbow

.Net链接Oracle必须是TnsName么?

[复制链接]
论坛徽章:
0
21#
发表于 2006-4-18 20:31 | 只看该作者
听别人介绍说最简单的方式就是装上ORACLE的客户端,
也不是很清楚

使用道具 举报

回复
招聘 : 产品经理/专员
论坛徽章:
67
管理团队2006纪念徽章
日期:2006-04-16 22:44:452012新春纪念徽章
日期:2012-01-04 11:50:442012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:25版主1段
日期:2012-05-15 15:24:112013年新春福章
日期:2013-02-25 14:51:24夏利
日期:2013-10-10 13:12:33
22#
发表于 2006-4-18 22:04 | 只看该作者
请大家看看这个第三方组件
http://down.qn165.com/view.asp?id=144


Oracle 的 .NET Framework 資料提供者
Oracle 的 .NET Framework 資料提供者透過 Oracle 用戶端連接軟體啟用對 Oracle 資料來源的資料存取。資料提供者支援 Oracle 用戶端軟體 8.1.7 (含) 以後版本。資料提供者支援本機和分散式交易 (資料提供者會自動登記在現有的分散式交易中,但目前並不支援 EnlistDistributedTransaction 方法)。如需詳細資訊,請參閱執行交易。

Oracle 的 .NET Framework 資料提供者需要您在使用它之前先在系統上安裝 Oracle 用戶端軟體 (8.1.7 (含) 以後版本),以便連接到 Oracle 資料來源。

Oracle 的 .NET Framework 資料提供者類別位於 System.Data.OracleClient 命名空間,並包含於 System.Data.OracleClient.dll 組件 (Assembly)。如果您要編譯的應用程式有使用資料提供者,則必須參考 System.Data.dll 和 System.Data.OracleClient.dll。

注意 Oracle 的 .NET Framework 資料提供者沒有隨附在 .NET Framework 1.0 版中。如果您需要 Oracle 的 .NET Framework 資料提供者,而且正使用 .NET Framework 1.0 版,您可以下載 Oracle 的 .NET Framework 資料提供者,網址為 http://msdn.microsoft.com/downloads。
下列程式碼範例顯示如何將 System.Data.SqlClient 命名空間納入您的應用程式。

[Visual Basic]
Imports System.Data.OracleClient
[C#]
using System.Data.OracleClient;

使用道具 举报

回复
招聘 : 产品经理/专员
论坛徽章:
67
管理团队2006纪念徽章
日期:2006-04-16 22:44:452012新春纪念徽章
日期:2012-01-04 11:50:442012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:25版主1段
日期:2012-05-15 15:24:112013年新春福章
日期:2013-02-25 14:51:24夏利
日期:2013-10-10 13:12:33
23#
发表于 2006-4-18 22:42 | 只看该作者
Oracle 9i Client and System.Data.OracleClient

If you haven't yet upgraded to a newer Oracle client (e.g. 9.2) or you are having problems with your current Oracle client (9i or higher) then you will need to take a few steps to make your client work as you might expect.  There are two main considerations:

TNSNAMES.ORA must be local
Permissions must be reset on your client directory
tnsnames.ora
Typically, companies will centralize the tnsnames.ora files (used for resolving Oracle service names) but putting it on a fileserver and pointing to it in the registry.  This works just fine for Oracle's toolset and many other client programs with the exception of the System.Data.OracleClient ADO.Net provider.  The provider, for some reason, expects this file to be installed locally (example: c:\oracle\ora92...\tnsnames.ora).  Installing (and perhaps mirroring from a network share) locally will take care of the first requirement.

Permissions
For some reason, the permissions for the "Authenticated Users" user is not fully propagated throughout the Oracle client install.  The fix for this is straightforward as well:

Open Explorer to your client install directory (c:\oracle\ora92)
Right-click ora92 and select propertied
Select the "Security" tab
Select the "Authenticated Users" entry
Uncheck the "Read and Execute" attribute
Click Apply
Re-check the "Read and Execute" attribute
Click Ok
Reset IIS

使用道具 举报

回复
论坛徽章:
12
授权会员
日期:2006-04-10 23:53:59会员2006贡献徽章
日期:2006-04-17 13:46:34开发板块每日发贴之星
日期:2006-10-09 01:03:11
24#
发表于 2006-4-19 10:45 | 只看该作者
看来还是有点麻烦,不像Java那么简单!

使用道具 举报

回复
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
25#
 楼主| 发表于 2006-4-22 22:40 | 只看该作者
最初由 赵宇 发布
[B]Oracle 9i Client and System.Data.OracleClient

If you haven't yet upgraded to a newer Oracle client (e.g. 9.2) or you are having problems with your current Oracle client (9i or higher) then you will need to take a few steps to make your client work as you might expect.  There are two main considerations:

TNSNAMES.ORA must be local
Permissions must be reset on your client directory
tnsnames.ora
Typically, companies will centralize the tnsnames.ora files (used for resolving Oracle service names) but putting it on a fileserver and pointing to it in the registry.  This works just fine for Oracle's toolset and many other client programs with the exception of the System.Data.OracleClient ADO.Net provider.  The provider, for some reason, expects this file to be installed locally (example: c:\oracle\ora92...\tnsnames.ora).  Installing (and perhaps mirroring from a network share) locally will take care of the first requirement.

Permissions
For some reason, the permissions for the "Authenticated Users" user is not fully propagated throughout the Oracle client install.  The fix for this is straightforward as well:

Open Explorer to your client install directory (c:\oracle\ora92)
Right-click ora92 and select propertied
Select the "Security" tab
Select the "Authenticated Users" entry
Uncheck the "Read and Execute" attribute
Click Apply
Re-check the "Read and Execute" attribute
Click Ok
Reset IIS [/B]


我当时就遇到了这个问题,文件系统是NTFS,.Net如何都不能找到TnsNames.ora,而在FAT32上就没有问题,后来查过后,发现是NTFS文件系统的权限设置问题,忙乎了一下,后来就OK了。

使用道具 举报

回复
论坛徽章:
4
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB元老
日期:2009-05-27 11:36:49
26#
发表于 2006-4-24 09:01 | 只看该作者
study

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2006-11-06 18:05:32
27#
发表于 2006-4-26 15:00 | 只看该作者
vs2005上有2.0版本

使用道具 举报

回复
论坛徽章:
12
授权会员
日期:2006-04-10 23:53:59会员2006贡献徽章
日期:2006-04-17 13:46:34开发板块每日发贴之星
日期:2006-10-09 01:03:11
28#
发表于 2006-4-26 15:06 | 只看该作者
最初由 cuilinny 发布
[B]vs2005上有2.0版本 [/B]


没看明白,什么意思?

使用道具 举报

回复
论坛徽章:
0
29#
发表于 2013-11-8 15:00 | 只看该作者
charles_gao 发表于 2006-4-5 09:56
老兄,你没有看清标题吧?
我们讨论的是不用tnsname.ora的情况!

(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.247)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = ORCL)))
没错的Plsql developer  的数据库那栏写成这样就OK了

使用道具 举报

回复
论坛徽章:
0
30#
发表于 2013-11-8 15:01 | 只看该作者
这时即使不没有安装Oracle客户端也是可以连接的

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表