How to connect to Oracle database ?

  • Thread starter Thread starter Hai Ly Hoang \(MT00KSTN\)
  • Start date Start date
H

Hai Ly Hoang \(MT00KSTN\)

Hi,
I'm an Oracle newbie. I've just created a table in Oracle with CREATE TABLE.
Now, in C#, how to connect to database and get my table ?
Thanks
 
Hi,

I am not sure a managed Oracle provider for ADO .NET exists, so you will
most likely need the OLEDB provider for Oracle installed on your client
computer, and you will be able to connect to your database like to any other
OLEDB data source.

You can create an empty file named, say, test_oracle.udl in Notepad and save
it.
Then, double-click on this file in Windows Explorer and configure a
connection to your Oracle database with the wizard appeared (make sure that
the connection works with the Test Connection button). Of course, you will
need the name of the database server, name of the database and probably some
other parameters (I have very little experience with Oracle so I cannot say
for sure). Then, open the UDL file again in Notepad and what you will see
below the section name enclosed with [] is a ready to use connection
string.

Then, configure an instance of OleDbConnection with this connection string
and hopefully it should work.
 
Back
Top