tags:

views:

413

answers:

2

Hi, 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...

+3  A: 

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).

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.

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

Fredrik Mörk
but my database in running on linux(running on virtual machine) and want to access it from main OS(XP).Wat will be the connection string for that
Nipun
I have not worked with Oracle DB's from .NET in a few years so I can't verify, but I think this is the connection string you want: "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;". You will of course need to replace MyHost, MyPort, MyOracleSID, myUsername and myPassword with the correct values for your virtual linux machine and Oracle database.
Fredrik Mörk
A: 

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).

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.

tuinstoel