473,396 Members | 1,834 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,396 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 6182
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.