Oracle Confusion

J

Jim Heavey

Hello, I am trying to figure out how to connect to an Oracle Database.

I was told that if I have Visual Studio.Net 2003, that the
Ststem.Data.Oracle namespace would install automatically. That does not
appear to to be the case.

http://www.able-
consulting.com/dotnet/adonet/Data_Providers.htm#OracleNETDataProvider
which is a resource for providing example connection strings, indicates
that the Microsoft Oracle provided is installed as part of the 1.1
Framework, but again, that does not appear to be the case. If I go to
the top of my program and write "Using System.Data." the system does not
show anything about Oracle... and I should see something for Oracle
right?

So I know where to download the namespace....but I am completly cluelsee
on exactly what a connection string looks like. "Able-Consulting.com"
shows the following as a valid connection string (in code):

OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "Data Source=Oracle8i;" +
"Integrated Security=SSPI";
oOracleConn.Open();

How does this connect to and Oracle table? Am I suppose to put
something in to replace "Oracle8i"? What would this be? My
tssnames.ora (I think this is the name of the file) looks something like
this:

Fred.WORLD =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (COMMUNITY = TCP.WORLD)(PROTOCOL = TCP)(HOST =
xx.xxx.xxx.xxx)(PORT = xxxx))

)

(CONNECT_DATA =

(SERVICE_NAME = Fred)

)


So what do I put into the "DataSource" ?

If I am using the IDE to build my connection string...Which provided do
I pick? I see a couple of them....


I would REALLY APPRECIATE YOUR HELP!!!!!!!!!!!!!

Thanks in advance for your assistance!!!!!!!!!
 
G

Guest

Hey Jim
Your DataSource should be "Fred

I have had issues connecting to Oracle from my .NET code. After trying all the providers, I found
that Microsoft OLEDB provider for Oracle was the most stable.
Let me know if you face any issues

Regards

Deepa
[I code, therefore I am
 
A

Angel Saenz-Badillos[MS]

The oracle provider ships with v1.1, but it is not in the System.Data.dll.
You need to add a reference to System.Data.OracleClient.dll to be able to
use it.
Thanks
 
B

Bob Clegg

Hi Jim,
Just been through similar grief myself.
1) The Oracle client name space is provided in 1.1 but the gotcha is that
you have to reference it like any other external dll. (Thanks to Kevin Yu
for this tip)

2) I have just got my connection string working.
I am not holding it up as a model as I haven't any security in place yet
but...
For the data source I am using the SID.
I have a User ID parameter and a password parameter.
That is all.
So assuming that you can connect to this database using SQl plus or TOAD
then:
The Datasource is the host name that you used in SQL plus.
Likewise the User ID and password parameters.
HTH
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top