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

时间:2023-01-07 18:54:36

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. Please help...

我在我的Fedora上运行虚拟机上的Oracle 10g快速版数据库。我想在windows Xp中创建一个运输表单,它将访问在vmware上运行的Oracle数据库。我尝试使用SQLCLient.I不知道哪个连接字符串我应该用。请帮忙...

2 个解决方案

#1


You will want to use the OracleClient instead of SqlClient (add a reference to System.Data.OracleClient). Reagarding the connection string, this is a great resource (direct link to .NET Framework Data Provider for Oracle).

您将需要使用OracleClient而不是SqlClient(添加对System.Data.OracleClient的引用)。重命名连接字符串,这是一个很好的资源(直接链接到.NET Framework数据提供程序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为许多类型实现相同的接口,例如IDbConnection和IDbCommand,因此通常最好让尽可能多的代码引用这些接口而不是它们的具体实现,以保持断开连接来自特定的提供商。

You may want to read this as well: Oracle and ADO.NET.

您可能也想阅读它:Oracle和ADO.NET。

#2


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). It has only a limited set of features and it is a little slow, Microsoft will not improve this provider in the future.

您还可以使用Microsoft的Oracle提供程序(System.Data.OracleClient,请参阅FredrikMörk)。它只有一组有限的功能,而且有点慢,微软将来不会改进这个提供商。

#1


You will want to use the OracleClient instead of SqlClient (add a reference to System.Data.OracleClient). Reagarding the connection string, this is a great resource (direct link to .NET Framework Data Provider for Oracle).

您将需要使用OracleClient而不是SqlClient(添加对System.Data.OracleClient的引用)。重命名连接字符串,这是一个很好的资源(直接链接到.NET Framework数据提供程序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为许多类型实现相同的接口,例如IDbConnection和IDbCommand,因此通常最好让尽可能多的代码引用这些接口而不是它们的具体实现,以保持断开连接来自特定的提供商。

You may want to read this as well: Oracle and ADO.NET.

您可能也想阅读它:Oracle和ADO.NET。

#2


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). It has only a limited set of features and it is a little slow, Microsoft will not improve this provider in the future.

您还可以使用Microsoft的Oracle提供程序(System.Data.OracleClient,请参阅FredrikMörk)。它只有一组有限的功能,而且有点慢,微软将来不会改进这个提供商。