PC Review


Reply
Thread Tools Rate Thread

Accessing an Oracle database with vb.net

 
 
Mark Brown
Guest
Posts: n/a
 
      26th Feb 2007
I'm trying to access an Oracle database vb.net. I found several examples.
I tried following each one, but I get the same error no matter what I try.
I don't really understand what the error means (I've never tried accessing
an Oracle database before). The error I get is:

ORA-12514: TNS:listener does not currently know of service requested in
connect descriptor

I installed the oracle dll and added it as reference (I get the same error
if I use the Oracle reference that came with VS2003.) I figure it's hitting
the database ok since if I change the name of the database it's connecting
to, I get an error that it couldn't resove the name. Here's the code I'm
using, pretty much straight from the example on Oracle's web site:

Dim con As OracleConnection = New OracleConnection

con.ConnectionString = "User ID=scott;Password=tiger;Data Source=oracledb;"

Try

con.Open()

Catch ex As Exception

tmp = ex.Message

End Try

Naturally, I'm using different user id, password and db name in my actual
code. The program errors on the con.Open() line.

Any ideas on where to look would be greatly appreciated.

Mark




 
Reply With Quote
 
 
 
 
Patrick Steele
Guest
Posts: n/a
 
      27th Feb 2007
In article <e#(E-Mail Removed)>, (E-Mail Removed)-
spam.org says...
> I'm trying to access an Oracle database vb.net. I found several examples.
> I tried following each one, but I get the same error no matter what I try.
> I don't really understand what the error means (I've never tried accessing
> an Oracle database before). The error I get is:
>
> ORA-12514: TNS:listener does not currently know of service requested in
> connect descriptor
>
> I installed the oracle dll and added it as reference (I get the same error
> if I use the Oracle reference that came with VS2003.) I figure it's hitting
> the database ok since if I change the name of the database it's connecting
> to, I get an error that it couldn't resove the name.


It's been a few years since I had to deal with Oracle, but I'll give it
a shot.

First, when you say you "installed the oracle dll", does that mean you
actually installed the oracle client? If not, I would install the
oracle client and include SQL plus during the installation. SQL Plus is
a kind of isql/w (if you're familiar with SQL Server).

Once the client is installed, make sure you tnsnames.ora file is
configured correctly. This, I can't help you with since I don't
remember what is necessary, but I do recall that was a source for
frequent frustration.

Third, make sure the Oracle listener service is running on the oracle
server.

Good luck!

--
Patrick Steele
http://weblogs.asp.net/psteele
 
Reply With Quote
 
Mark Brown
Guest
Posts: n/a
 
      27th Feb 2007
"Patrick Steele" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In article <e#(E-Mail Removed)>, (E-Mail Removed)-
> spam.org says...
>> I'm trying to access an Oracle database vb.net. I found several
>> examples.
>> I tried following each one, but I get the same error no matter what I
>> try.
>> I don't really understand what the error means (I've never tried
>> accessing
>> an Oracle database before). The error I get is:
>>
>> ORA-12514: TNS:listener does not currently know of service requested in
>> connect descriptor
>>
>> I installed the oracle dll and added it as reference (I get the same
>> error
>> if I use the Oracle reference that came with VS2003.) I figure it's
>> hitting
>> the database ok since if I change the name of the database it's
>> connecting
>> to, I get an error that it couldn't resove the name.

>
> It's been a few years since I had to deal with Oracle, but I'll give it
> a shot.
>
> First, when you say you "installed the oracle dll", does that mean you
> actually installed the oracle client? If not, I would install the
> oracle client and include SQL plus during the installation. SQL Plus is
> a kind of isql/w (if you're familiar with SQL Server).
>
> Once the client is installed, make sure you tnsnames.ora file is
> configured correctly. This, I can't help you with since I don't
> remember what is necessary, but I do recall that was a source for
> frequent frustration.
>
> Third, make sure the Oracle listener service is running on the oracle
> server.
>
> Good luck!


Thanks for the reply. I do have the client installed and I can access the
database using Query Builder. But in my application, when it tries to
connect, I get that error, which from what I've been able to find out means
that I contacted the server, but not registered with the listener. But no
one ever seems to mention how to do that.

Mark


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
50 concurrent web users on asp.net 2.0 accessing Oracle database jobs Microsoft ASP .NET 2 19th Jun 2007 06:08 PM
Accessing oracle database through excel cell =?Utf-8?B?Y29ldXM=?= Microsoft Excel Misc 8 10th Aug 2006 01:48 AM
Accessing Oracle Database Arun Microsoft ADO .NET 4 21st May 2005 01:32 AM
Accessing Oracle Database from PocektPC / Palm dev guy Microsoft Dot NET Compact Framework 1 30th Jun 2004 01:39 PM
Error accessing Oracle database from a web service Jeff Microsoft C# .NET 6 15th Oct 2003 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:05 PM.