473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Trouble connecting to Oracle database from C#

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

Jul 3 '07 #1
5 8375
ki***********@gmail.com wrote:
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
A googling finds a lot of references to this problem.

Many of them indicate a mismatch between connection string
and tnsnames.ora.

So you should check that.

An interesting twist is:
http://www.phpbuilder.com/board/arch...hp/t-6705.html

Arne

PS: Why not use an Oracle ADO.NET provider instead of OLE DB ?
Jul 4 '07 #2
Hi!

As I wrote, I do not intend to install a Oracle client on the PCs if I
can avoid it. So there is no tnsnames.ora file on the machine. The
application uses the included dlls. If I use the exact same settings
on my test w2k machine without Oracle client or server installed, it
works. I think it perhaps would work if I also installed a Oracle
client on all the machines and then used the tnsname in the connection
string but that is a lot of work and a lot of software for such a
simple task.

Actually I did not write the code myself but if it makes things easier
to use Oracle ADO.NET instead of OLE DB, I will change it.

/Kim
On 4 Jul., 03:15, Arne Vajhøj <a...@vajhoej.dkwrote:
kimtherkel...@gmail.com wrote:
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

A googling finds a lot of references to this problem.

Many of them indicate a mismatch between connection string
and tnsnames.ora.

So you should check that.

An interesting twist is:
http://www.phpbuilder.com/board/arch...hp/t-6705.html

Arne

PS: Why not use an Oracle ADO.NET provider instead of OLE DB ?

Jul 4 '07 #3
<ki***********@gmail.comschrieb im Newsbeitrag
news:11**********************@n60g2000hse.googlegr oups.com...
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
This is a error message from Oracle. Since OLEDB is not C# specific. I
suppose you should ask this in an Oracle group.

Christof
Jul 4 '07 #4

We solved the problem!

A ORACLE_HOME environment path had to be set to point at the folder
containing the dlls. Otherwise this specific PC would look for the
libraries in other places because it previously had a Oracle 9i client
installed.

Best regards,
Kim Therkelsen

On 4 Jul., 10:56, "Christof Nordiek" <c...@nospam.dewrote:
<kimtherkel...@gmail.comschrieb im Newsbeitragnews:11**********************@n60g2000h se.googlegroups.com...
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

This is a error message from Oracle. Since OLEDB is not C# specific. I
suppose you should ask this in an Oracle group.

Christof

Jul 4 '07 #5
ki***********@gmail.com wrote:
As I wrote, I do not intend to install a Oracle client on the PCs if I
can avoid it. So there is no tnsnames.ora file on the machine. The
application uses the included dlls. If I use the exact same settings
on my test w2k machine without Oracle client or server installed, it
works. I think it perhaps would work if I also installed a Oracle
client on all the machines and then used the tnsname in the connection
string but that is a lot of work and a lot of software for such a
simple task.

Actually I did not write the code myself but if it makes things easier
to use Oracle ADO.NET instead of OLE DB, I will change it.
I believe that all Oracle only supports solutions with
Oracle client installed on PC's (except for Java JDBC thin
driver, which is probably not so relevant for you).

Arne
Jul 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yahibble | last post by:
Now, I am no Python expert but I have dabbled and I have spent a couple of days with another engineer unsuccessfully installing oracle drivers for MS ODBC on the win XP machine. It looked to me...
2
by: tim.pascoe | last post by:
I'm currently trying to establish a linked server to an Oracle database. Setup: Connecting to 8x version of Oracle Using 9i client tools (Net Manager) SQL-Server 2000 Windows 2000 I...
2
by: python_eager | last post by:
Hi i am connecting my database oracle 9i. While connecting i am getting the following error connection = cx_Oracle.connect("myusername", "mypassword", "python") RuntimeError: Unable to acquire...
3
by: jens Jensen | last post by:
exception: "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater." fails at connection.Open();
0
by: antonyliu2002 | last post by:
I am having a hard time connecting to an oracle database from within Visual Web Developer (VWD) 2005 Express Edition. Check out the screen snap shot here: ...
2
by: rcc.gamer | last post by:
Hello All, I am trying to connect a GridView to an Oracle table using the standard SqlDataSource. The process is fairly simple and there are detailed instructions from Microsoft ......
0
by: piyushdabomb | last post by:
Hi Oracle Gurus!! Before I proceed, as per the moderators request, I would like to mention that I have already taken a look at the other threads pertaining to a similar issue which I am having and...
7
by: cyberbilly1 | last post by:
Hi All! I'm trying to connect to a remote oracle database using the OracleConnection within VB.net . Whenever I try connecting I get a SocketException:No connection could be made because the...
1
by: kinnu | last post by:
hi, could any one help me with the steps of connecting the vb form with the oracle database/table. I could connect vb to access. as my collage project requires connecting of vb with oracle...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.