简体   繁体   English

使用C#表单连接Oracle数据库

[英]Connection for Oracle database with C# form

I making a Oracle 10g express edition database in my fedora which is running on virtual machine.I want to create a shipping form in windows Xp which will access that Oracle database running on vmware.I tried using SQLCLient.I have no idea which Connection string i should use. 我在运行在虚拟机上的fedora中制作了Oracle 10g速成版数据库。我想在Windows Xp中创建一个运输表格,该表格将访问在vmware上运行的Oracle数据库。我尝试使用SQLCLient。我不知道哪个连接字符串我应该用。 Please help... 请帮忙...

You will want to use the OracleClient instead of SqlClient (add a reference to System.Data.OracleClient). 您将要使用OracleClient而不是SqlClient(添加对System.Data.OracleClient的引用)。 Reagarding the connection string, this is a great resource ( direct link to .NET Framework Data Provider for Oracle ). 重新获得连接字符串, 这是一个很好的资源直接链接到.NET Framework Data Provider for Oracle )。

Note that the OracleClient and SqlClient implement the same interfaces for many types, such as IDbConnection and IDbCommand , so it's usually a good idea to have as much of your code as possible refer to those interfaces rather than specific implementations of them, to keep it disconnected from the specific provider. 请注意,OracleClient和SqlClient为许多类型实现相同的接口,例如IDbConnectionIDbCommand ,因此通常最好让尽可能多的代码引用这些接口,而不是它们的特定实现,以保持断开连接来自特定提供商。

You may want to read this as well: Oracle and ADO.NET . 您可能还需要阅读以下内容: Oracle和ADO.NET

You could try ODP.NET ( http://www.oracle.com/technology/tech/windows/odpnet/index.html ) or Devart's provider ( http://www.devart.com/dotconnect/oracle/ ) or DataDirect's provider ( http://www.datadirect.com/products/net/net_for_oracle/index.ssp ). 您可以尝试使用ODP.NET( http://www.oracle.com/technology/tech/windows/odpnet/index.html )或Devart的提供程序( http://www.devart.com/dotconnect/oracle/ )或DataDirect的提供程序( http://www.datadirect.com/products/net/net_for_oracle/index.ssp )。

You can also use Microsoft's provider for Oracle (System.Data.OracleClient, see Fredrik Mörk). 您也可以使用Microsoft的Oracle提供程序(System.Data.OracleClient,请参见FredrikMörk)。 It has only a limited set of features and it is a little slow, Microsoft will not improve this provider in the future. 它只有有限的一组功能,并且速度有些慢,Microsoft将来不会改进此提供程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM