Connecting to Oracle in 2005

So all i'm trying to do is query an oracle DB from  I get a slew of error messages depending on the connection string/driver/prodiver i use.
What gets me is that i can ping the server, tsnping, connect through Data Sources(ODBC), and Oracle's 'SQL Developer' tool but I can't using Vs.
My latest effort has me at
Dim oSQLConn As New OleDb.OleDbConnection
Which gives me "ORA-12560: TNS:protocol adapter error"
That connection string was taken straight out of the tnsnames.ora created by Sql developer.
Please keep in mind I'm a novice at anything oracle.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
If you have the tnsnames.ora, then you could use the simple form of the connection string, and the System.Data.OracleClient namespace:

Oracle connection strings:

Data Source=MyOracleDB;Integrated Security=yes;

Imports System.Data.OracleClient
Public Function GetReceivedDateCount() As Integer
Dim connectionString As String = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString
Using connection As New OracleConnection(connectionString))
   Dim commandText As String = "Select Count(Received_Date) As CountDates From Receiving"
   Using command As New OracleCommand(commandText, connection)
        Dim countDates As Integer = command.ExecuteScalar()
        Return countDates
   End Using
End Using
End Function

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cvoutourAuthor Commented:
I don't have a '' namespace available.
i've been to the site many times, tried every example there.
cvoutourAuthor Commented:
Correction: I have the namespace, i just get an error on
Dim connectionString As String = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString
Bob LearnedCommented:
That was just an example of getting a connection string from a configuration file.  You would need to add a reference to the System.Configuration.dll, and a Imports System.Configuration to your project and code module.

cvoutourAuthor Commented:
I had to tweak it a bit, replacing the connectionString with the info i had listed above, but the namespace seems to be what i needed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.