如何编写.Net应用程序,与两个SqlServer的和Oracle工作(现在System.Data.OracleClient的是德precated) [英] How to write a .Net application that works with both SqlServer and Oracle (now that System.Data.OracleClient is deprecated)

查看:263
本文介绍了如何编写.Net应用程序,与两个SqlServer的和Oracle工作(现在System.Data.OracleClient的是德precated)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

又见<一href="http://stackoverflow.com/questions/1004484/system-data-oracleclient-namespace-discontinued">System.Data.OracleClient停产命名空间?

(首先不要惊慌尚未,System.Data.OracleClient的是不被微软移除,然而它是不是在.NET 4的客户端版本)

(Firstly don’t panic yet, System.Data.OracleClient is not being removed by Microsoft yet, however it is not in the client version of .net 4)

这使用通过使用System.Data.OracleClient的,<一个可能href="http://blogs.msdn.com/adonet/archive/2009/06/15/system-data-oracleclient-update.aspx?CommentPosted=true#commentmessage">however微软已经决定不再将precate OracleClient的。 (OracleClient的是由微软和船舶发展作为.NET Framework的一部分的ADO.NET提供程序的Oracle。)

This use to be possible by using System.Data.OracleClient, however Microsoft has decided to deprecate OracleClient. (OracleClient is the ADO.NET provider for Oracle developed by Microsoft and ships as a part of the .NET Framework.)

您可以使用ODP.Net,但你希望你的SQL Server的客户必须安装ODP.Net? (您希望您的任何客户有安装Oracle软件?)

You could use ODP.Net, however do you wish your Sql Server customers to have to install ODP.Net? (Do you wish any of your customers to have to install Oracle software?)

的DataDirect 是不是一种选择,因为它的成本一只胳膊和一条腿;它可能只是负担得起,如果你需要一台服务器连接到主机。然而,它并不指望所有的客户购买它的一个选项。

DataDirect is not an option as it costs an arm and a leg; it may just about be affordable if you need to connect a single server to a mainframe. However it is not an option to expect all customers to buy it.

动的形式C#与Java不是一个好的选择,因为我是一个C#程序员,希望能够谋生!

Moving form C# to Java is not a good option, as I am a C# programmer and wish to be able to earn a living!

最喜欢的独立软件开发商有支持多个RDBMS,我们只需要一个解决方案,使我们能够使用Oracle的小部分是一样的SqlServer。因此System.Data.OracleClient的是足够强大的我们。

Like most ISVs that have to support multiple RDBMS we only need a solution that allows us to use the small subset of Oracle that is the same as SqlServer. Therefore System.Data.OracleClient was powerful enough for us.

(也许我们应该开始存储在平面文件中的所有数据,让客户的DBA停止试图告诉我们如何编写软件。甲骨文数据库管理员都糟了!)

(Maybe we should just start storing all data in flat files, so that customer’s DBA stop trying to tell us how to write software. Oracle DBAs are the worse!)

我的真正的问题是我怎么可以编写.NET软件,讨论甲骨文是免费安装作为会谈SqlServer的.NET软件,我们的痛苦。不必使用ODP.NET只是让Oracle客户端安装了更多的痛苦,其中有更多出问题。

My real question is how can I write .NET software that talks to Oracle that is us pain free to installed as .NET software that talks to SqlServer. Having to use ODP.NET just makes the oracle client install yet more painful, with yet more to go wrong.

如果我是用JAVA我可以只使用JDBC类型4驱动程序。微软提供了一个用于SqlServer的和Oracle提供了一个用于Oracle。然而似乎甲骨文希望使净使用量尽可能的努力和微软希望让Oracle的使用尽可能的努力。

If I was using JAVA I could just use JDBC type 4 drivers. Microsoft provides one for SqlServer and Oracle provides one for Oracle. However it seems that Oracle wishes to make .Net usage as hard as possible and Microsoft wishes to make Oracle usage as hard as possible.

目前在最好的选择看起来像 devArt的的dotConnect

但是我开始怀疑天气.NET是ISV了良好的发展体系,迟早你总是得到,要求甲骨文支持的客户。在Java世界里,他们似乎有这个问题就解决了​​。

它看起来像甲骨文可能即将带出一个senible完全托管ADO.NET提供themselfs它甚至可能很容易安装!看<一href="http://www.oracle.com/technetwork/topics/dotnet/tech-info/ow2010-whatsnew-dotnet-177300.pdf">here声称β - 2011年,生产 - 2011年底

It looks like Oracle may be about to bring out a senible Fully Managed ADO.NET provider themselfs it may even be easy to install! see here that claims Beta – 2011, Production – End of 2011.

推荐答案

编辑:全面管理ODP.NET现在已经投入生产使用。它是非常小的(小于10MB),并且是不依赖于其他文件。你可以在这里获得:

The fully managed ODP.NET is now available in production. It is very small (less than 10MB) and is not dependent on other files. You can obtain it here:

http://www.oracle.com/technetwork/topics/ DOTNET /下载/ index.html的

原来的答复:

一个方法的轻松的保证所需的Oracle客户端软件(包括ODP.NET)总是可用的部署机上是与您的应用程序中嵌入它。 ODP.NET已经得到了的很多的现在更容易嵌入该XCOPY ODP.NET可用。你可以从这个链接下载:

One way to easily ensure that the required Oracle client side software (including ODP.NET) is always available on the deployment machine is to embed it with your application. ODP.NET has gotten a lot easier to embed now that XCOPY ODP.NET is available. You can download it from this link:

http://www.oracle.com/technology/软件/技术/窗/ odpnet / index.html的

使用XCOPY ODP.NET,所有你需要的时候你部署的应用程序做的是以下内容:

With XCOPY ODP.NET, all you need to do when you deploy your application is the following:

1)将您的应用程序到目标机

1) Copy your application to the target machine

2)运行INSTALL.BAT的副本一对甲骨文的DLL到目标机器(包括ODP.NET和Oracle客户端(OCI)软件)

2) Run "install.bat" which copies a couple of Oracle DLL's to the target machine (including ODP.NET and the Oracle client side (OCI) software)

3)运行configure.bat,这的确是GACUTIL,并更新目标计算机的注册表

3) Run "configure.bat", which does a "gacutil" and updates the registry of the target machine

4)提供连接字符串信息,你的应用程序。您可以使用EZCONNECT连接字符串(主机名@服务名),或者你(或你的客户)可以通过设置TNS_ADMIN注册表项或环境变量共享preexisting SQLNET配置为指向另一个Oracle家里有SQLNET已连接的别名配置的。

4) Provide your application with connect string information. You can use the EZCONNECT connect string ("hostname@servicename") or you (or your customer) can share preexisting sqlnet configurations by setting the TNS_ADMIN registry entry or environment variable to point to another Oracle home that has sqlnet connect aliases already configured.

这就是它!这是真的那么简单。

That's it! It is really that simple.

我希望你能好好看看ODP.NET XCOPY在上面的链接,看看自己是多么容易的这些天嵌入ODP.NET与您的应用程序。

I hope you will take a good look at ODP.NET XCOPY in the link above to see for yourself how easy it is these days to embed ODP.NET with your app.

其他注意事项:

如果您选择不嵌入ODP.NET与应用程序,微软OracleClient的双方的情况和ODP.NET的情况下,需要有安装在任何机器部署额外的Oracle客户端(OCI)软件。两种情况之间唯一的区别是,当你使用ODP.NET,它也需要存在部署计算机上。好消息是,一个典型的Oracle客户机上安装包括ODP.NET了。

If you choose not to embed ODP.NET with your application, in both the case of Microsoft OracleClient and in the case of ODP.NET, there needs to be additional Oracle client side (OCI) software installed on any deployment machine. The only difference between the two cases is that when you are using ODP.NET, it also needs to exist on the deployment machine. The good news is that a typical Oracle install on your customer machine will include ODP.NET already.

现在,如果你的目标机器上已经安装ODP.NET,你不需要做任何事情。你只需要分发应用程序。如果确实需要使用标准安装程序安装ODP.NET,你也可以从上面提供的链接下载。标准ODP.NET安装只需要几分钟,配置为你的一切。

Now, if your target machine already has ODP.NET installed you don't need to do anything else. You just need to distribute your application. If you do need to install ODP.NET using the standard installer, you can also download it from the link provided above. The standard ODP.NET install only takes a few minutes and configures everything for you.

再次,你可以使用EZCONNECT连接字符串,以使网络配置一块蛋糕,或者使用TNS_ADMIN注册表项或环境变量来利用pre-现有的连接,你的客户已经习惯了使用别名

And again, you can use EZConnect connect strings to make networking configuration a piece of cake, or use the TNS_ADMIN registry entry or environment variable to take advantage of pre-existing connect aliases that your customer is already used to using.

希望这有助于

基督教吉文

甲骨文

随时提供有关这一点,我们的功能要求网站的其它未来功能您的反馈意见: http://apex.oracle.com/pls/apex/f?p = 18357:46

Feel free to provide your feedback on this and other future features at our feature request website: http://apex.oracle.com/pls/apex/f?p=18357:46

这篇关于如何编写.Net应用程序,与两个SqlServer的和Oracle工作(现在System.Data.OracleClient的是德precated)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆