473,404 Members | 2,137 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,404 software developers and data experts.

Why invalid argument when connecting to an OracleDatabase ?

From a CSharp program I would like to connect to an OracleDatabase
with thefollowing code:

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
....

string connectionstring = "User Id=peterm;Password=mypasswd;Data Source=XE;";
OracleConnection connection = new OracleConnection(connectionstring);
connection.Open();

In the Open() command I am getting an erro back:
ORA-12532 TNS invalid argument.

Why ?

I am absolute sure that I entered the correct login name and password.
So it must be either the Data Source argument or the syntax of the conntionstring.

I am using the Oracle Express version and the default database name is "XE".

So what else can be the error ?

When I define an ODBC Data Source TestOracle and connect with the following string:

string connectionstring = "User Id=peterm;Password=mypasswd;Data Source=TestOracle;";

I am getting an "ORA-12154 TNS connect could not resolved".
What's wrong with this ?

Wolfgang
May 25 '07 #1
3 6183
Wolfgang Meister wrote:
From a CSharp program I would like to connect to an OracleDatabase
with thefollowing code:

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
...

string connectionstring = "User Id=peterm;Password=mypasswd;Data Source=XE;";
OracleConnection connection = new OracleConnection(connectionstring);
connection.Open();

In the Open() command I am getting an erro back:
ORA-12532 TNS invalid argument.

Why ?

I am absolute sure that I entered the correct login name and password.
So it must be either the Data Source argument or the syntax of the conntionstring.

I am using the Oracle Express version and the default database name is "XE".

So what else can be the error ?

When I define an ODBC Data Source TestOracle and connect with the following string:

string connectionstring = "User Id=peterm;Password=mypasswd;Data Source=TestOracle;";

I am getting an "ORA-12154 TNS connect could not resolved".
What's wrong with this ?
What do you have in tnsnames.ora ?

Arne
May 25 '07 #2

"Wolfgang Meister" <wm******@hotmail.comwrote in message
news:46***********************@newsspool4.arcor-online.net...
From a CSharp program I would like to connect to an OracleDatabase
with thefollowing code:

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
...

string connectionstring = "User Id=peterm;Password=mypasswd;Data
Source=XE;";
OracleConnection connection = new OracleConnection(connectionstring);
connection.Open();

In the Open() command I am getting an erro back:
ORA-12532 TNS invalid argument.

Why ?

I am absolute sure that I entered the correct login name and password.
So it must be either the Data Source argument or the syntax of the
conntionstring.

I am using the Oracle Express version and the default database name is
"XE".

So what else can be the error ?

When I define an ODBC Data Source TestOracle and connect with the
following string:

string connectionstring = "User Id=peterm;Password=mypasswd;Data
Source=TestOracle;";

I am getting an "ORA-12154 TNS connect could not resolved".
What's wrong with this ?

Wolfgang
May 25 '07 #3

"Wolfgang Meister" <wm******@hotmail.comwrote in message
news:46***********************@newsspool4.arcor-online.net...
From a CSharp program I would like to connect to an OracleDatabase
with thefollowing code:

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
...

string connectionstring = "User Id=peterm;Password=mypasswd;Data
Source=XE;";
OracleConnection connection = new OracleConnection(connectionstring);
connection.Open();

In the Open() command I am getting an erro back:
ORA-12532 TNS invalid argument.

Why ?

I am absolute sure that I entered the correct login name and password.
So it must be either the Data Source argument or the syntax of the
conntionstring.

I am using the Oracle Express version and the default database name is
"XE".

So what else can be the error ?

When I define an ODBC Data Source TestOracle and connect with the
following string:

string connectionstring = "User Id=peterm;Password=mypasswd;Data
Source=TestOracle;";

I am getting an "ORA-12154 TNS connect could not resolved".
What's wrong with this ?
Oracle is tricky. If you're doing a try/catch, then look at the Exception
InnerText messages, which may give you the exact cause of the error. That's
where I had to go in order to see what Oracle was barking about.

May 25 '07 #4

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

Similar topics

4
by: Gianluca | last post by:
This is the simplified code I'm trying to generate: ilg.DeclareLocal(typeof(int)); // define local integer Label exit = ilg.DefineLabel(); // define "exit" label ...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
0
by: schosch | last post by:
Hello @all, we're connecting from a DB2UDB V7 on Windows to a DB2UDB on AIX. We had no problems while the version on AIX was still V7, but after wie updated the AIX-Part to V8.1 FP13 we cannot...
2
by: Wolfgang Meister | last post by:
From a CSharp program I would like to connect to an OracleDatabase with thefollowing code: using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; .... string connectionstring = "User...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
4
by: robert | last post by:
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert ============== ...
8
by: Lambda | last post by:
When I call the standard strncpy function, I provide it a negative argument, such as: strncpy(s, ct, -1) I compile the code with gcc, when I run, it says "Segmentation fault". Do you think...
9
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.