473,505 Members | 13,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What do I have to write in OracleConnection string for "Data Source" ?

I tried to connect to an existing Oracle Database with the following ConnectionString:

using System.Data.OracleClient; // + Added Reference "System.Data.OracleClient"

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

This code yields an "Invalid argument" ORA-12532 error.

Why ?

Even when I switch to

using Oracle.DataAccess.Client; // + Added Reference "Oracle.DataAccess"

I got the same error.

"XE" is the name of the Oracle Express Database.

What else can I do ?
Does the sequence of Data Source, User Id and Password in the connection string matter ?

Do I have to declare the "Data Source" somewhere else (beside the Reference)?

Werner

May 30 '07 #1
2 9594
Hi,

Check http://www.connectionstrings.com/

"Werner Sammer" <we****@yahoo.dewrote in message
news:46***********************@newsspool3.arcor-online.net...
>I tried to connect to an existing Oracle Database with the following
ConnectionString:

using System.Data.OracleClient; // + Added Reference
"System.Data.OracleClient"

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

This code yields an "Invalid argument" ORA-12532 error.

Why ?

Even when I switch to

using Oracle.DataAccess.Client; // + Added Reference "Oracle.DataAccess"

I got the same error.

"XE" is the name of the Oracle Express Database.

What else can I do ?
Does the sequence of Data Source, User Id and Password in the connection
string matter ?

Do I have to declare the "Data Source" somewhere else (beside the
Reference)?

Werner

May 30 '07 #2
Werner Sammer wrote:
I tried to connect to an existing Oracle Database with the following ConnectionString:

using System.Data.OracleClient; // + Added Reference "System.Data.OracleClient"

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

This code yields an "Invalid argument" ORA-12532 error.

Why ?

Even when I switch to

using Oracle.DataAccess.Client; // + Added Reference "Oracle.DataAccess"

I got the same error.

"XE" is the name of the Oracle Express Database.

What else can I do ?
Does the sequence of Data Source, User Id and Password in the connection string matter ?

Do I have to declare the "Data Source" somewhere else (beside the Reference)?

Werner

1. in web.config:

<connectionStrings>
<add name="jamieOracle" connectionString="user
id=jamie;password=jamie;data
source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=j amieamd)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ja mie)))"/>
</connectionStrings>

2. in your app:

// create an Oracle data provider connection:
string connStr =
ConfigurationManager.ConnectionStrings["jamieOracle"].ConnectionString;
OracleConnection con = new OracleConnection(connStr);

May 30 '07 #3

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

Similar topics

3
4678
by: 21novembre | last post by:
Hi all, I made a question several days before to describe my strange trouble of mysqldump. But I still can't figour it out. Well, I just want to ask another question whether I could just backup...
6
1998
by: kobu.selva | last post by:
I was recently part of a little debate on the issue of whether constants and string literals are considered "data objects" in C. I'm more confused now than before. I was always under the...
2
4894
by: jerry.ranch | last post by:
I've been using row source with the QBE for my list and combo boxes..when would I use control source? jerry
0
4989
by: saraDotNet | last post by:
hi everybody , I'm a beginner student in vb.net,and I'm working on a very small project as a homework,and I've some questions which I ought to search for their solutions via any source . My...
2
2102
by: joe.kimbler | last post by:
What is the best way to handle updates in databases with each release of a software package? I used to work on an accounting package in FoxPro that had a "Data Dictionary" and as your code...
0
1743
by: Anthony Paul | last post by:
Hello everyone! I have been looking for information regarding the SOA tenet of decoupling the client interface from the web service interface. I understand the value of not sharing a contract...
1
1485
by: Rob Meade | last post by:
Hi all, I have my own collection own which implements ienumerable and ienumator. I was recently using a GridView and I was prompted that I could not turn on paging because the data source (my...
0
4041
by: wildman | last post by:
Trying to read XML files from SSIS and load into SQL Server. I tested this before and it was working before I placed in a forevery contrainer. also, my simple xml file had to be retyped cause I...
4
6695
by: santhanalakshmi | last post by:
Hi, In ODBC, i given data source name and the test connection is also successful. But i don't know, why i am facing this error DBI connect('wwwdsn','webid',...) failed: Data...
0
7098
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
7298
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
7366
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...
1
7017
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
7471
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
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.