Trouble connecting to Oracle from C#

  • Thread starter Thread starter kimtherkelsen
  • Start date Start date
K

kimtherkelsen

Hi,
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:

dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;

This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:

ORA-06401: NETCMN: Invalid driver designator

I have tried to reproduce the error on a VMWARE Windows 2000 sp4
machine (that does not have a Oracle server or client installed) but
there it works after installing MDAC version 2.8. I am not able to
reproduce the error...

Do you have any idea what is wrong?

I include the the following DLL files with the code:
oraociei10.dll, oci.dll, oraocci10.dll, ociw32.dll, orannzsbb10.dll

Best regards,
Kim Therkelsen
 
Why not use the OracleClient .NET native provider?

--
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest books:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
Hitchhiker's Guide to SQL Server 2005 Compact Edition
 
Hi,
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:

dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;

This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:

ORA-06401: NETCMN: Invalid driver designator

I have tried to reproduce the error on a VMWARE Windows 2000 sp4
machine (that does not have a Oracle server or client installed) but
there it works after installing MDAC version 2.8. I am not able to
reproduce the error...

Do you have any idea what is wrong?

I include the the following DLL files with the code:
oraociei10.dll, oci.dll, oraocci10.dll, ociw32.dll, orannzsbb10.dll

Best regards,
Kim Therkelsen

Have a look at this tutorial
http://www.codeproject.com/useritems/C__Instant_Oracle.asp
 
Kim

I'm not familiar with the Data Source value, normally this would just be the
service name or SID specified in the tnsnames.ora file, e.g.

"Data source=test.world;user id=scott;password=tiger;"

tnsnames.ora entry...

test.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <server_name>)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test)
)
)

As Bill Vaughn suggested, use System.Data.OracleClient, or, ODP.net
http://www.oracle.com/technology/tech/windows/odpnet/index.html.

HTH

Glenn
 
Back
Top